mirror of
https://github.com/python/cpython.git
synced 2025-10-21 06:02:21 +00:00
gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole (#119557)
This commit is contained in:
parent
c0faade891
commit
86d1a1aa88
3 changed files with 11 additions and 1 deletions
|
@ -101,7 +101,7 @@ class InteractiveColoredConsole(code.InteractiveConsole):
|
|||
item = wrapper([stmt])
|
||||
try:
|
||||
code = compile(item, filename, the_symbol, dont_inherit=True)
|
||||
except (OverflowError, ValueError):
|
||||
except (OverflowError, ValueError, SyntaxError):
|
||||
self.showsyntaxerror(filename)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue