diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-07 19:40:18 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-07 19:40:18 +0000 |
commit | 1a591a6ee59ad59b2107fe113fcbfd3cb30879aa (patch) | |
tree | 0febb74ef1b5cee418eba57c53efef574795416d | |
parent | de83c76040a64a4f4997ce70214fa3f44c411695 (diff) | |
download | portage-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.tar.gz portage-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.tar.bz2 portage-1a591a6ee59ad59b2107fe113fcbfd3cb30879aa.zip |
Always use basestring instead of str with isinstance().
svn path=/main/trunk/; revision=12775
-rw-r--r-- | pym/_emerge/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/cache/template.py | 2 | ||||
-rw-r--r-- | pym/portage/mail.py | 2 | ||||
-rw-r--r-- | pym/portage/process.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index f643cc3df..0b60e0fd2 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 7fce8ef17..e78216338 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 cf6ebd134..72b411264 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 7c0fb342f..6f449c3d6 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 |