summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-07 19:40:18 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-07 19:40:18 +0000
commit1a591a6ee59ad59b2107fe113fcbfd3cb30879aa (patch)
tree0febb74ef1b5cee418eba57c53efef574795416d
parentAllow unicode type values in config.__setitem__(). Thanks to Arfrever Frehtes (diff)
downloadportage-multirepo-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.tar.gz
portage-multirepo-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.tar.bz2
portage-multirepo-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.zip
Always use basestring instead of str with isinstance().
svn path=/main/trunk/; revision=12775
-rw-r--r--pym/_emerge/__init__.py2
-rw-r--r--pym/portage/cache/template.py2
-rw-r--r--pym/portage/mail.py2
-rw-r--r--pym/portage/process.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index f643cc3d..0b60e0fd 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -9728,7 +9728,7 @@ class JobStatusDisplay(object):
object.__setattr__(self, "_term_codes", term_codes)
encoding = sys.getdefaultencoding()
for k, v in self._term_codes.items():
- if not isinstance(v, str):
+ if not isinstance(v, basestring):
self._term_codes[k] = v.decode(encoding, 'replace')
def _init_term(self):
diff --git a/pym/portage/cache/template.py b/pym/portage/cache/template.py
index 7fce8ef1..e7821633 100644
--- a/pym/portage/cache/template.py
+++ b/pym/portage/cache/template.py
@@ -169,7 +169,7 @@ class database(object):
for key,match in match_dict.iteritems():
# XXX this sucks.
try:
- if isinstance(match, str):
+ if isinstance(match, basestring):
restricts[key] = re.compile(match).match
else:
restricts[key] = re.compile(match[0],match[1]).match
diff --git a/pym/portage/mail.py b/pym/portage/mail.py
index cf6ebd13..72b41126 100644
--- a/pym/portage/mail.py
+++ b/pym/portage/mail.py
@@ -17,7 +17,7 @@ def create_message(sender, recipient, subject, body, attachments=None):
for x in attachments:
if isinstance(x, BaseMessage):
mymessage.attach(x)
- elif isinstance(x, str):
+ elif isinstance(x, basestring):
mymessage.attach(TextMessage(x))
else:
raise portage.exception.PortageException("Can't handle type of attachment: %s" % type(x))
diff --git a/pym/portage/process.py b/pym/portage/process.py
index 7c0fb342..6f449c3d 100644
--- a/pym/portage/process.py
+++ b/pym/portage/process.py
@@ -175,7 +175,7 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False,
"""
# mycommand is either a str or a list
- if isinstance(mycommand, str):
+ if isinstance(mycommand, basestring):
mycommand = mycommand.split()
# If an absolute path to an executable file isn't given