Commit 98ff898c authored by Martin v. Löwis's avatar Martin v. Löwis

Expect that source strings are Unicode.

parent e83395ee
...@@ -586,14 +586,16 @@ class ModifiedInterpreter(InteractiveInterpreter): ...@@ -586,14 +586,16 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.more = 0 self.more = 0
self.save_warnings_filters = warnings.filters[:] self.save_warnings_filters = warnings.filters[:]
warnings.filterwarnings(action="error", category=SyntaxWarning) warnings.filterwarnings(action="error", category=SyntaxWarning)
if isinstance(source, types.UnicodeType): # at the moment, InteractiveInterpreter expects str
from . import IOBinding assert isinstance(source, str)
try: #if isinstance(source, str):
source = source.encode(IOBinding.encoding) # from . import IOBinding
except UnicodeError: # try:
self.tkconsole.resetoutput() # source = source.encode(IOBinding.encoding)
self.write("Unsupported characters in input\n") # except UnicodeError:
return # self.tkconsole.resetoutput()
# self.write("Unsupported characters in input\n")
# return
try: try:
# InteractiveInterpreter.runsource() calls its runcode() method, # InteractiveInterpreter.runsource() calls its runcode() method,
# which is overridden (see below) # which is overridden (see below)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment