mirror of
https://github.com/python/cpython.git
synced 2025-09-17 06:06:25 +00:00
bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft keywords (GH-26630)
(cherry picked from commit 457ce60fc7
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
664ae29e6f
commit
f807a4fad4
3 changed files with 31 additions and 5 deletions
|
@ -215,6 +215,7 @@ class ExceptionTests(unittest.TestCase):
|
|||
check('[\nfile\nfor str(file)\nin\n[]\n]', 3, 5)
|
||||
check('[file for\n str(file) in []]', 2, 2)
|
||||
check("ages = {'Alice'=22, 'Bob'=23}", 1, 16)
|
||||
check('match ...:\n case {**rest, "key": value}:\n ...', 2, 19)
|
||||
|
||||
# Errors thrown by compile.c
|
||||
check('class foo:return 1', 1, 11)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue