@@ -2409,6 +2409,11 @@ ast_for_flow_stmt(struct compiling *c, const node *n)
24092409 n -> n_col_offset , c -> c_arena );
24102410 }
24112411 else if (NCH (ch ) == 4 ) {
2412+ if (Py_Py3kWarningFlag &&
2413+ !ast_3x_warn (c , n , "the raise clause with three components is not supported in 3.x" ,
2414+ "use 'raise' with a single object" )) {
2415+ return NULL ;
2416+ }
24122417 expr_ty expr1 , expr2 ;
24132418
24142419 expr1 = ast_for_expr (c , CHILD (ch , 1 ));
@@ -3059,6 +3064,20 @@ ast_for_except_clause(struct compiling *c, const node *exc, node *body)
30593064 asdl_seq * suite_seq ;
30603065 expr_ty expression ;
30613066 expr_ty e = ast_for_expr (c , CHILD (exc , 3 ));
3067+ expr_ty as_or_comma = ast_for_expr (c , CHILD (exc , 2 ));
3068+
3069+ if (TYPE (CHILD (exc , 2 )) == COMMA )
3070+ if (Py_Py3kWarningFlag &&
3071+ !ast_3x_warn (c , exc , "the commas syntax for the except clause is not supported in 3.x" ,
3072+ "use the 'as' syntax instead" )) {
3073+ return NULL ;
3074+ }
3075+ if (e == Tuple_kind )
3076+ if (Py_Py3kWarningFlag &&
3077+ !ast_3x_warn (c , exc , "Iterable exceptions are not supported in 3.x" ,
3078+ "access the arguments through the 'args' attribute instead" )) {
3079+ return NULL ;
3080+ }
30623081 if (!e )
30633082 return NULL ;
30643083 if (!set_context (c , e , Store , CHILD (exc , 3 )))
0 commit comments