From: Guido van Rossum Date: Tue, 31 Mar 1992 18:49:18 +0000 (+0000) Subject: Tighten syntax for try statements X-Git-Tag: v0.9.8~418 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af82141bb6ca0ac4728df76184634e947a7cc2e4;p=thirdparty%2FPython%2Fcpython.git Tighten syntax for try statements --- diff --git a/Grammar/Grammar b/Grammar/Grammar index 84f289841156..24dc70e3d886 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -92,7 +92,8 @@ compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] while_stmt: 'while' test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] -try_stmt: 'try' ':' suite (except_clause ':' suite)* ['finally' ':' suite] +try_stmt: 'try' ':' suite (except_clause ':' suite)+ | 'try' ':' suite 'finally' ':' suite +# NB compile.c makes sure that the default except clause is last except_clause: 'except' [test [',' test]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT