mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Expect that source strings are Unicode.
This commit is contained in:
parent
e83395ee79
commit
98ff898c46
1 changed files with 10 additions and 8 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue