From 48450cf0a94765c010eddfbbfc5c85380e6a9a15 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 15 Jan 2001 18:13:35 +0000 Subject: [PATCH] mwh@sourceforge found that UnicodeError can be raised by compiling. Its base class ValueError can be raised too, so catch that. --- Lib/code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/code.py b/Lib/code.py index 3cd33dee48..846cd04642 100644 --- a/Lib/code.py +++ b/Lib/code.py @@ -70,7 +70,7 @@ class InteractiveInterpreter: """ try: code = compile_command(source, filename, symbol) - except (OverflowError, SyntaxError): + except (OverflowError, SyntaxError, ValueError): # Case 1 self.showsyntaxerror(filename) return 0 -- 2.50.1