gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)

Automerge-Triggered-By: GH:lysnikolaou
This commit is contained in:
Lysandros Nikolaou 2022-11-20 18:11:02 +01:00 committed by GitHub
parent b0e1f9c241
commit 9c4232ae89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1018 additions and 974 deletions

View file

@ -2017,12 +2017,12 @@ class SyntaxTestCase(unittest.TestCase):
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)
lineno=3, end_lineno=3, offset=1, end_offset=8)
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)
lineno=3, end_lineno=3, offset=1, end_offset=7)
def test_empty_line_after_linecont(self):
# See issue-40847