summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorGrigoriev Semyon <33061489+grigoriev-semyon@users.noreply.github.com>2024-04-04 15:22:43 (GMT)
committerGitHub <noreply@github.com>2024-04-04 15:22:43 (GMT)
commita49426afaa470894cc3d2771d0510935b5a844b8 (patch)
treefade1d2d40f12e827a980dc5f3f469f7e9ddbee4 /Lib/test/test_syntax.py
parent663e7bc2eed89c72e795d7b855c7ff283c0264c1 (diff)
downloadcpython-a49426afaa470894cc3d2771d0510935b5a844b8.zip
cpython-a49426afaa470894cc3d2771d0510935b5a844b8.tar.gz
cpython-a49426afaa470894cc3d2771d0510935b5a844b8.tar.bz2
[3.12] gh-109120: Fix syntax error in handlinh of incorrect star expressions… (#117465)
gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444) (cherry picked from commit c97d3af2391e62ef456ef2365d48ab9b8cdbe27b)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index d8f1ee5..3039a92 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -1816,22 +1816,22 @@ A[*(1:2)]
>>> A[*(1:2)]
Traceback (most recent call last):
...
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
>>> A[*(1:2)] = 1
Traceback (most recent call last):
...
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
>>> del A[*(1:2)]
Traceback (most recent call last):
...
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
A[*:] and A[:*]
>>> A[*:]
Traceback (most recent call last):
...
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
>>> A[:*]
Traceback (most recent call last):
...
@@ -1842,7 +1842,7 @@ A[*]
>>> A[*]
Traceback (most recent call last):
...
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
A[**]
@@ -1986,11 +1986,23 @@ Invalid expressions in type scopes:
>>> f(**x, *)
Traceback (most recent call last):
- SyntaxError: iterable argument unpacking follows keyword argument unpacking
+ SyntaxError: Invalid star expression
>>> f(x, *:)
Traceback (most recent call last):
- SyntaxError: invalid syntax
+ SyntaxError: Invalid star expression
+
+ >>> f(x, *)
+ Traceback (most recent call last):
+ SyntaxError: Invalid star expression
+
+ >>> f(x = 5, *)
+ Traceback (most recent call last):
+ SyntaxError: Invalid star expression
+
+ >>> f(x = 5, *:)
+ Traceback (most recent call last):
+ SyntaxError: Invalid star expression
"""
import re