[3.10] bpo-46004: Fix error location for loops with invalid targets (GH-29959). (GH-29961)

(cherry picked from commit 1c7a1c3be0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
Pablo Galindo Salgado 2021-12-07 15:23:33 +00:00 committed by GitHub
parent f78c229b4e
commit c521412003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -234,6 +234,7 @@ class ExceptionTests(unittest.TestCase):
check("ages = {'Alice'=22, 'Bob'=23}", 1, 16)
check('match ...:\n case {**rest, "key": value}:\n ...', 2, 19)
check("[a b c d e f]", 1, 2)
check("for x yfff:", 1, 7)
# Errors thrown by compile.c
check('class foo:return 1', 1, 11)