Correct location for syntax error in try-except (GH-25939)

This commit is contained in:
Mark Shannon 2021-05-06 13:38:50 +01:00 committed by GitHub
parent 60ba0b6847
commit 8d4b18429d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -218,7 +218,7 @@ class ExceptionTests(unittest.TestCase):
check('class foo:return 1', 1, 11)
check('def f():\n continue', 2, 3)
check('def f():\n break', 2, 3)
check('try:\n pass\nexcept:\n pass\nexcept ValueError:\n pass', 2, 3)
check('try:\n pass\nexcept:\n pass\nexcept ValueError:\n pass', 3, 1)
# Errors thrown by tokenizer.c
check('(0x+1)', 1, 3)