Widen test to support unicode.

This commit is contained in:
Martin v. Löwis 2012-07-09 21:07:41 +02:00
parent e8e4e1456c
commit 9e6bf1a8ee
2 changed files with 2 additions and 2 deletions

View File

@ -1265,7 +1265,7 @@ class PseudoFile(object):
self.encoding = encoding self.encoding = encoding
def write(self, s): def write(self, s):
if not isinstance(s, str): if not isinstance(s, basestring):
raise TypeError('must be str, not ' + type(s).__name__) raise TypeError('must be str, not ' + type(s).__name__)
self.shell.write(s, self.tags) self.shell.write(s, self.tags)

View File

@ -263,7 +263,7 @@ class _RPCFile(io.TextIOBase):
return setattr(self.rpc, name, value) return setattr(self.rpc, name, value)
def write(self, s): def write(self, s):
if not isinstance(s, str): if not isinstance(s, basestring):
raise TypeError('must be str, not ' + type(s).__name__) raise TypeError('must be str, not ' + type(s).__name__)
return self.rpc.write(s) return self.rpc.write(s)