summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-13 06:03:15 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-13 06:03:15 (GMT)
commit98ff898c4637208f28f862a64779c2ea3f4b809d (patch)
tree575527f73a6d54d05628ba8a792fdf46eaa679e6 /Lib/idlelib/PyShell.py
parente83395ee79845a6696281545472c1802fd81232a (diff)
downloadcpython-98ff898c4637208f28f862a64779c2ea3f4b809d.zip
cpython-98ff898c4637208f28f862a64779c2ea3f4b809d.tar.gz
cpython-98ff898c4637208f28f862a64779c2ea3f4b809d.tar.bz2
Expect that source strings are Unicode.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r--Lib/idlelib/PyShell.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 18ed3aa..1cfc330 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -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)