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):
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
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))
"""
# 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