summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-10-19 15:50:36 +0100
committerGitHub <noreply@github.com>2020-10-19 15:50:36 +0100
commitc82f10450c547eb94a04ee17b7c816ff31948297 (patch)
treead305c05c5745e1a5e7c136545bec7eefa741e32 /Lib/test/test_syntax.py
parenteee6bb50c69d94280f43b47390ea9d1b5f42930c (diff)
parentb580ed1d9d55461d8dde027411b90be26cae131e (diff)
downloadcpython-git-bpo-39107.tar.gz
Merge branch 'master' into bpo-39107bpo-39107
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4657fd1c0d..7c3302c1d4 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -752,14 +752,6 @@ Corner-cases that used to fail to raise the correct error:
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__
- >>> def f(*args:(lambda __debug__:0)): pass
- Traceback (most recent call last):
- SyntaxError: cannot assign to __debug__
-
- >>> def f(**kwargs:(lambda __debug__:0)): pass
- Traceback (most recent call last):
- SyntaxError: cannot assign to __debug__
-
>>> with (lambda *:0): pass
Traceback (most recent call last):
SyntaxError: named arguments must follow bare *
@@ -950,6 +942,15 @@ pass
except SyntaxError:
self.fail("Empty line after a line continuation character is valid.")
+ @support.cpython_only
+ def test_nested_named_except_blocks(self):
+ code = ""
+ for i in range(12):
+ code += f"{' '*i}try:\n"
+ code += f"{' '*(i+1)}raise Exception\n"
+ code += f"{' '*i}except Exception as e:\n"
+ code += f"{' '*4*12}pass"
+ self._check_error(code, "too many statically nested blocks")
def test_main():
support.run_unittest(SyntaxTestCase)