diff options
| author | Pablo Galindo <Pablogsal@gmail.com> | 2021-02-03 23:29:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-03 23:29:26 +0000 |
| commit | d4e6ed7e5fb43320ea714d7436bc11667c624d43 (patch) | |
| tree | 1b7139c3a92eb9de5b91e61b5d5a7e92bed07bd7 /Lib/test/test_syntax.py | |
| parent | bfe544d2f2c2e7a7c03a764bed3276a1e27a0f5c (diff) | |
| download | cpython-git-d4e6ed7e5fb43320ea714d7436bc11667c624d43.tar.gz | |
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
Diffstat (limited to 'Lib/test/test_syntax.py')
| -rw-r--r-- | Lib/test/test_syntax.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 6068dd9fc0..70dd22c62a 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -246,9 +246,25 @@ SyntaxError: did you forget parentheses around the comprehension target? Traceback (most recent call last): SyntaxError: did you forget parentheses around the comprehension target? ->>> {x,y: None for x,y in range(100)} +# Missing commas in literals collections should not +# produce special error messages regarding missing +# parentheses + +>>> [1, 2 3] Traceback (most recent call last): -SyntaxError: did you forget parentheses around the comprehension target? +SyntaxError: invalid syntax + +>>> {1, 2 3} +Traceback (most recent call last): +SyntaxError: invalid syntax + +>>> {1:2, 2:5 3:12} +Traceback (most recent call last): +SyntaxError: invalid syntax + +>>> (1, 2 3) +Traceback (most recent call last): +SyntaxError: invalid syntax From compiler_complex_args(): |
