aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-10-27 20:54:20 +0200
committerGitHub <noreply@github.com>2020-10-27 20:54:20 +0200
commit15acc4eaba8519d7d5f2acaffde65446b44dcf79 (patch)
tree9e67e28b551fd67a2ffb24e7cc6b7d11b3584db6 /Lib/test/test_syntax.py
parent95f710c55714153f0c8cce48f8215bb3d866ac1d (diff)
downloadcpython-15acc4eaba8519d7d5f2acaffde65446b44dcf79.tar.gz
cpython-15acc4eaba8519d7d5f2acaffde65446b44dcf79.zip
bpo-41659: Disallow curly brace directly after primary (GH-22996)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 7c3302c1d46..c25b85246b9 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -802,6 +802,9 @@ class SyntaxTestCase(unittest.TestCase):
else:
self.fail("compile() did not raise SyntaxError")
+ def test_curly_brace_after_primary_raises_immediately(self):
+ self._check_error("f{", "invalid syntax", mode="single")
+
def test_assign_call(self):
self._check_error("f() = 1", "assign")