Widen test to support unicode.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 9 Jul 2012 19:07:41 +0000 (21:07 +0200)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 9 Jul 2012 19:07:41 +0000 (21:07 +0200)
Lib/idlelib/PyShell.py
Lib/idlelib/run.py

index 14f062e09de80e61b6d01f0ddf21d3eb96500ee7..3e23e6c0ad24795b15ca89bd07ab37f50e0cefb6 100644 (file)
@@ -1265,7 +1265,7 @@ class PseudoFile(object):
         self.encoding = encoding
 
     def write(self, s):
-        if not isinstance(s, str):
+        if not isinstance(s, basestring):
             raise TypeError('must be str, not ' + type(s).__name__)
         self.shell.write(s, self.tags)
 
index 82db38a781ca2ec0bc2c7162734f355f595ef665..9389a2b0aad1c4d8aacfc2c7f6e36089880ec8bd 100644 (file)
@@ -263,7 +263,7 @@ class _RPCFile(io.TextIOBase):
         return setattr(self.rpc, name, value)
 
     def write(self, s):
-        if not isinstance(s, str):
+        if not isinstance(s, basestring):
             raise TypeError('must be str, not ' + type(s).__name__)
         return self.rpc.write(s)