mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-99153: set location on SyntaxError for try with both except and except* (GH-99160)
This commit is contained in:
parent
d3b82b4463
commit
61b6c40b64
4 changed files with 16 additions and 5 deletions
|
|
@ -2014,6 +2014,16 @@ def test_generator_in_function_call(self):
|
|||
"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"""\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue