mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) (GH-30064)
(cherry picked from commit 59435eea08
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
991736697d
commit
438817fdd5
5 changed files with 869 additions and 826 deletions
|
@ -268,9 +268,10 @@ class ExceptionTests(unittest.TestCase):
|
|||
check(b"\xef\xbb\xbf#coding: utf8\nprint('\xe6\x88\x91')\n", 0, -1)
|
||||
|
||||
# Errors thrown by symtable.c
|
||||
check('x = [(yield i) for i in range(3)]', 1, 5)
|
||||
check('def f():\n from _ import *', 1, 1)
|
||||
check('def f(x, x):\n pass', 1, 1)
|
||||
check('x = [(yield i) for i in range(3)]', 1, 7)
|
||||
check('def f():\n from _ import *', 2, 17)
|
||||
check('def f(x, x):\n pass', 1, 10)
|
||||
check('{i for i in range(5) if (j := 0) for j in range(5)}', 1, 38)
|
||||
check('def f(x):\n nonlocal x', 2, 3)
|
||||
check('def f(x):\n x = 1\n global x', 3, 3)
|
||||
check('nonlocal x', 1, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue