summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-12-12 01:24:12 (GMT)
committerGitHub <noreply@github.com>2021-12-12 01:24:12 (GMT)
commit438817fdd5b731d486285d205bed2e78b655c0d6 (patch)
treebaee17de51ea0d5c3400f22dcf6ec52fb951af29 /Lib
parent991736697dff693b6c9f8964bb7540081bbf4ddb (diff)
downloadcpython-438817fdd5b731d486285d205bed2e78b655c0d6.zip
cpython-438817fdd5b731d486285d205bed2e78b655c0d6.tar.gz
cpython-438817fdd5b731d486285d205bed2e78b655c0d6.tar.bz2
bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059) (GH-30064)
(cherry picked from commit 59435eea08d30796174552c0ca03c59b41adf8a5) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_exceptions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index bc5f83a..9acb16c 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -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)