]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Some weird forms of try statements are no longer allowed.
authorGuido van Rossum <guido@python.org>
Tue, 31 Mar 1992 18:54:11 +0000 (18:54 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 31 Mar 1992 18:54:11 +0000 (18:54 +0000)
Lib/test/test_grammar.py

index 3f1447f682546c7e0f8f15416e19d88cda3ec92f..9662439669c988a6b8c1b9aff9eecaed381d9e60 100644 (file)
@@ -193,9 +193,8 @@ for i, j, k in (): pass
 else: pass
 [3]
 
-print 'try_stmt' # 'try' ':' suite (except_clause ':' suite)* ['finally' ':' suite]
+print 'try_stmt' # 'try' ':' suite (except_clause ':' suite)+ | 'try' ':' suite 'finally' ':' suite
 ### except_clause: 'except' [expr [',' expr]]
-try: pass
 try: 1/0
 except ZeroDivisionError: pass
 try: 1/0
@@ -205,9 +204,6 @@ except RuntimeError, msg: pass
 except: pass
 try: pass
 finally: pass
-try: 1/0
-except: pass
-finally: pass
 
 print 'suite' # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT
 if 1: pass