[Python-checkins] CVS: python/dist/src/Lib/test test_exceptions.py,1.11,1.12 test_grammar.py,1.28,1.29
Jeremy Hylton
jhylton@users.sourceforge.net
Thu, 01 Feb 2001 14:48:14 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv23698/Lib/test
Modified Files:
test_exceptions.py test_grammar.py
Log Message:
Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
Index: test_exceptions.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** test_exceptions.py 2000/10/23 17:00:30 1.11
--- test_exceptions.py 2001/02/01 22:48:12 1.12
***************
*** 105,130 ****
while 1:
try:
- continue
- except:
- pass
- '''
- ckmsg(s, "'continue' not supported inside 'try' clause")
- s = '''\
- while 1:
- try:
- continue
- finally:
pass
- '''
- ckmsg(s, "'continue' not supported inside 'try' clause")
- s = '''\
- while 1:
- try:
- if 1:
- continue
finally:
! pass
'''
! ckmsg(s, "'continue' not supported inside 'try' clause")
s = '''\
try:
--- 105,113 ----
while 1:
try:
pass
finally:
! continue
'''
! ckmsg(s, "'continue' not supported inside 'finally' clause")
s = '''\
try:
Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** test_grammar.py 2001/02/01 20:20:45 1.28
--- test_grammar.py 2001/02/01 22:48:12 1.29
***************
*** 350,353 ****
--- 350,372 ----
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