diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-01 22:48:12 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-01 22:48:12 (GMT) |
commit | 3faa52ecc4aeb30f8913b4dd105184f6f7bc733d (patch) | |
tree | d4c6c78e934c98ef15aaf79fae249063b5a41a1b /Lib/test/test_grammar.py | |
parent | 1bbc04831071891c5bbeb53a2c1defbbf83245d9 (diff) | |
download | cpython-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.py | 19 |
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 |