diff options
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r-- | Tools/idle/PyShell.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index cf854d3c3b..31a89402cf 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: |