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
with patch.object(console, "showsyntaxerror") as mock_showsyntaxerror:
console.runsource(source)
mock_showsyntaxerror.assert_called_once()
+ source = dedent("""\
+ match 1:
+ case {0: _, 0j: _}:
+ pass
+ """)
+ with patch.object(console, "showsyntaxerror") as mock_showsyntaxerror:
+ console.runsource(source)
+ mock_showsyntaxerror.assert_called_once()
def test_no_active_future(self):
console = InteractiveColoredConsole()