summaryrefslogtreecommitdiffstats
path: root/Lib/_pyrepl
diff options
context:
space:
mode:
authorSergey B Kirpichev <skirpichev@gmail.com>2024-05-29 06:57:50 (GMT)
committerGitHub <noreply@github.com>2024-05-29 06:57:50 (GMT)
commit86d1a1aa8841ea182eaf434ae6b942b3e93f58db (patch)
treecf1ccb08df50de774df8d0cca2af903905437040 /Lib/_pyrepl
parentc0faade891e6ccb61137041fe10cc05e5fa8d534 (diff)
downloadcpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.zip
cpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.tar.gz
cpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.tar.bz2
gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole (#119557)
Diffstat (limited to 'Lib/_pyrepl')
-rw-r--r--Lib/_pyrepl/simple_interact.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_pyrepl/simple_interact.py b/Lib/_pyrepl/simple_interact.py
index b5f182e..11e831c 100644
--- a/Lib/_pyrepl/simple_interact.py
+++ b/Lib/_pyrepl/simple_interact.py
@@ -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