summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index b822bc9..7253842 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -2014,6 +2014,16 @@ class SyntaxTestCase(unittest.TestCase):
"Generator expression must be parenthesized",
lineno=1, end_lineno=1, offset=11, end_offset=53)
+ def test_except_then_except_star(self):
+ self._check_error("try: pass\nexcept ValueError: pass\nexcept* TypeError: pass",
+ r"cannot have both 'except' and 'except\*' on the same 'try'",
+ lineno=1, end_lineno=1, offset=1, end_offset=4)
+
+ def test_except_star_then_except(self):
+ self._check_error("try: pass\nexcept* ValueError: pass\nexcept TypeError: pass",
+ r"cannot have both 'except' and 'except\*' on the same 'try'",
+ lineno=1, end_lineno=1, offset=1, end_offset=4)
+
def test_empty_line_after_linecont(self):
# See issue-40847
s = r"""\