summaryrefslogtreecommitdiff
path: root/Tools/idle/PyShell.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/idle/PyShell.py')
-rw-r--r--Tools/idle/PyShell.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py
index 31a89402cf..e71a9a17a5 100644
--- a/Tools/idle/PyShell.py
+++ b/Tools/idle/PyShell.py
@@ -191,7 +191,12 @@ class ModifiedInterpreter(InteractiveInterpreter):
warnings.filterwarnings(action="error", category=SyntaxWarning)
if isinstance(source, types.UnicodeType):
import IOBinding
- source = source.encode(IOBinding.encoding)
+ try:
+ source = source.encode(IOBinding.encoding)
+ except UnicodeError:
+ self.tkconsole.resetoutput()
+ self.write("Unsupported characters in input")
+ return
try:
return InteractiveInterpreter.runsource(self, source, filename)
finally: