diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-06-09 21:20:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-09 21:20:01 (GMT) |
commit | 457ce60fc70f1c9290023f46fb82b6a490dff32e (patch) | |
tree | ce11ef3395d5dee461c809150b57c7ea8f212596 /Lib/test/test_syntax.py | |
parent | 878d7e4ee464913438fd59582bbb795e7e0fa387 (diff) | |
download | cpython-457ce60fc70f1c9290023f46fb82b6a490dff32e.zip cpython-457ce60fc70f1c9290023f46fb82b6a490dff32e.tar.gz cpython-457ce60fc70f1c9290023f46fb82b6a490dff32e.tar.bz2 |
bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft keywords (GH-26630)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 5d3ce4c..72e4ab1 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -267,7 +267,7 @@ Traceback (most recent call last): SyntaxError: invalid syntax. Perhaps you forgot a comma? # Make sure soft keywords constructs don't raise specialized -# errors regarding missing commas +# errors regarding missing commas or other spezialiced errors >>> match x: ... y = 3 @@ -280,6 +280,24 @@ SyntaxError: invalid syntax Traceback (most recent call last): SyntaxError: invalid syntax +>>> match x: +... case $: +... ... +Traceback (most recent call last): +SyntaxError: invalid syntax + +>>> match ...: +... case {**rest, "key": value}: +... ... +Traceback (most recent call last): +SyntaxError: invalid syntax + +>>> match ...: +... case {**_}: +... ... +Traceback (most recent call last): +SyntaxError: invalid syntax + From compiler_complex_args(): >>> def f(None=1): |