diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-07-14 22:00:03 -0700 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-07-14 22:00:03 -0700 |
commit | 39b667e2459725bc81680dac41d1bb3992c09d63 (patch) | |
tree | efe9d42432be4cc7c99d1a7f05984a0bc928c2d9 /Lib/test | |
parent | c0c8da515a521d4b61d089ceb873ee17e80ac985 (diff) | |
download | cpython-39b667e2459725bc81680dac41d1bb3992c09d63.tar.gz |
make too many nested blocks be a SyntaxError instead of a SystemError (closes #27514)
Patch by Ammar Askar.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_syntax.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 057441c83c..83f49f6580 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -342,7 +342,9 @@ isn't, there should be a syntax error. ... SyntaxError: 'break' outside loop -This should probably raise a better error than a SystemError (or none at all). +This raises a SyntaxError, it used to raise a SystemError. +Context for this change can be found on issue #27514 + In 2.5 there was a missing exception and an assert was triggered in a debug build. The number of blocks must be greater than CO_MAXBLOCKS. SF #1565514 @@ -370,7 +372,7 @@ build. The number of blocks must be greater than CO_MAXBLOCKS. SF #1565514 ... break Traceback (most recent call last): ... - SystemError: too many statically nested blocks + SyntaxError: too many statically nested blocks Misuse of the nonlocal statement can lead to a few unique syntax errors. |