summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-10-28 21:19:07 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-10-28 21:19:07 (GMT)
commit21997afb0c764d5eb50dbe52249d838a597c0a08 (patch)
treee118a87953cd76f730255d9f3cb9e3017a219068 /Lib
parent97a57220e8cfd857c7f46ec9d71f9f841c241fa8 (diff)
downloadcpython-21997afb0c764d5eb50dbe52249d838a597c0a08.zip
cpython-21997afb0c764d5eb50dbe52249d838a597c0a08.tar.gz
cpython-21997afb0c764d5eb50dbe52249d838a597c0a08.tar.bz2
Fix bug #1565514, SystemError not raised on too many nested blocks.
It seems like this should be a different error than SystemError, but I don't have any great ideas and SystemError was raised in 2.4 and earlier. Will backport.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_syntax.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 8143032..f452298 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -336,6 +336,37 @@ isn't, there should be a syntax error.
Traceback (most recent call last):
...
SyntaxError: 'break' outside loop (<doctest test.test_syntax[42]>, line 3)
+
+This should probably raise a better error than a SystemError (or none at all).
+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
+
+ >>> while 1:
+ ... while 2:
+ ... while 3:
+ ... while 4:
+ ... while 5:
+ ... while 6:
+ ... while 8:
+ ... while 9:
+ ... while 10:
+ ... while 11:
+ ... while 12:
+ ... while 13:
+ ... while 14:
+ ... while 15:
+ ... while 16:
+ ... while 17:
+ ... while 18:
+ ... while 19:
+ ... while 20:
+ ... while 21:
+ ... while 22:
+ ... break
+ Traceback (most recent call last):
+ ...
+ SystemError: too many statically nested blocks
+
"""
import re