Skip to content

Commit 627efd9

Browse files
committed
Some weird forms of try statements are no longer allowed.
1 parent 643d932 commit 627efd9

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

Lib/test/test_grammar.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ def f():
193193
else: pass
194194
[3]
195195

196-
print 'try_stmt' # 'try' ':' suite (except_clause ':' suite)* ['finally' ':' suite]
196+
print 'try_stmt' # 'try' ':' suite (except_clause ':' suite)+ | 'try' ':' suite 'finally' ':' suite
197197
### except_clause: 'except' [expr [',' expr]]
198-
try: pass
199198
try: 1/0
200199
except ZeroDivisionError: pass
201200
try: 1/0
@@ -205,9 +204,6 @@ def f():
205204
except: pass
206205
try: pass
207206
finally: pass
208-
try: 1/0
209-
except: pass
210-
finally: pass
211207

212208
print 'suite' # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT
213209
if 1: pass

0 commit comments

Comments
 (0)