summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-01 22:48:12 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-01 22:48:12 (GMT)
commit3faa52ecc4aeb30f8913b4dd105184f6f7bc733d (patch)
treed4c6c78e934c98ef15aaf79fae249063b5a41a1b /Lib/test/test_grammar.py
parent1bbc04831071891c5bbeb53a2c1defbbf83245d9 (diff)
downloadcpython-3faa52ecc4aeb30f8913b4dd105184f6f7bc733d.zip
cpython-3faa52ecc4aeb30f8913b4dd105184f6f7bc733d.tar.gz
cpython-3faa52ecc4aeb30f8913b4dd105184f6f7bc733d.tar.bz2
Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 6e0fe91..b7af64a 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -349,6 +349,25 @@ print 'continue_stmt' # 'continue'
i = 1
while i: i = 0; continue
+msg = ""
+while not msg:
+ msg = "continue + try/except ok"
+ try:
+ continue
+ msg = "continue failed to continue inside try"
+ except:
+ msg = "continue inside try called except block"
+print msg
+
+msg = ""
+while not msg:
+ msg = "finally block not called"
+ try:
+ continue
+ finally:
+ msg = "continue + try/finally ok"
+print msg
+
print 'return_stmt' # 'return' [testlist]
def g1(): return
def g2(): return 1