]> granicus.if.org Git - python/commitdiff
mwh@sourceforge found that UnicodeError can be raised by compiling.
authorGuido van Rossum <guido@python.org>
Mon, 15 Jan 2001 18:13:35 +0000 (18:13 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Jan 2001 18:13:35 +0000 (18:13 +0000)
Its base class ValueError can be raised too, so catch that.

Lib/code.py

index 3cd33dee48db2b08228ca996c40981a0dddfc982..846cd0464234e9c1afff42d920d6d6a161c82da2 100644 (file)
@@ -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