summaryrefslogtreecommitdiffstats
path: root/Tools/idle/PyShell.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-08-05 14:55:21 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-08-05 14:55:21 (GMT)
commiteade4a158049be814a38bb9faeafaddb8404f6b0 (patch)
tree084f42276a53445ea13ecd33a9ededb06255331d /Tools/idle/PyShell.py
parent5428fff1111dac0a3308f33a576cce8de33f18dd (diff)
downloadcpython-eade4a158049be814a38bb9faeafaddb8404f6b0.zip
cpython-eade4a158049be814a38bb9faeafaddb8404f6b0.tar.gz
cpython-eade4a158049be814a38bb9faeafaddb8404f6b0.tar.bz2
Patch #590913: PEP 263 support.
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r--Tools/idle/PyShell.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index cf854d3..31a8940 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -6,6 +6,7 @@ import string
import getopt
import re
import warnings
+import types
import linecache
from code import InteractiveInterpreter
@@ -188,6 +189,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.more = 0
self.save_warnings_filters = warnings.filters[:]
warnings.filterwarnings(action="error", category=SyntaxWarning)
+ if isinstance(source, types.UnicodeType):
+ import IOBinding
+ source = source.encode(IOBinding.encoding)
try:
return InteractiveInterpreter.runsource(self, source, filename)
finally: