mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
[3.13] gh-126139: Improve error message location for future statement with unknown feature (GH-126140) (#126155)
gh-126139: Improve error message location for future statement with unknown feature (GH-126140)
(cherry picked from commit 224c370a36
)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
This commit is contained in:
parent
f37ac53cd3
commit
b9cbc58e13
4 changed files with 18 additions and 8 deletions
|
@ -319,8 +319,8 @@ class ExceptionTests(unittest.TestCase):
|
|||
check('def f():\n global x\n nonlocal x', 2, 3)
|
||||
|
||||
# Errors thrown by future.c
|
||||
check('from __future__ import doesnt_exist', 1, 1)
|
||||
check('from __future__ import braces', 1, 1)
|
||||
check('from __future__ import doesnt_exist', 1, 24)
|
||||
check('from __future__ import braces', 1, 24)
|
||||
check('x=1\nfrom __future__ import division', 2, 1)
|
||||
check('foo(1=2)', 1, 5)
|
||||
check('def f():\n x, y: int', 2, 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue