]> granicus.if.org Git - python/commitdiff
Expect that source strings are Unicode.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 13 Aug 2007 06:03:15 +0000 (06:03 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 13 Aug 2007 06:03:15 +0000 (06:03 +0000)
Lib/idlelib/PyShell.py

index 18ed3aa57fe407db867c24eb46d2e9d8b26c231f..1cfc330d65e758ce5c10312e7b9d65bdde578683 100644 (file)
@@ -586,14 +586,16 @@ class ModifiedInterpreter(InteractiveInterpreter):
         self.more = 0
         self.save_warnings_filters = warnings.filters[:]
         warnings.filterwarnings(action="error", category=SyntaxWarning)
-        if isinstance(source, types.UnicodeType):
-            from . import IOBinding
-            try:
-                source = source.encode(IOBinding.encoding)
-            except UnicodeError:
-                self.tkconsole.resetoutput()
-                self.write("Unsupported characters in input\n")
-                return
+        # at the moment, InteractiveInterpreter expects str
+        assert isinstance(source, str)
+        #if isinstance(source, str):
+        #    from . import IOBinding
+        #    try:
+        #        source = source.encode(IOBinding.encoding)
+        #    except UnicodeError:
+        #        self.tkconsole.resetoutput()
+        #        self.write("Unsupported characters in input\n")
+        #        return
         try:
             # InteractiveInterpreter.runsource() calls its runcode() method,
             # which is overridden (see below)