@@ -3184,18 +3184,6 @@ compiler_continue(struct compiler *c, location loc)
31843184}
31853185
31863186
3187- static location
3188- location_of_last_executing_statement (asdl_stmt_seq * stmts )
3189- {
3190- for (Py_ssize_t i = asdl_seq_LEN (stmts ) - 1 ; i >= 0 ; i ++ ) {
3191- location loc = LOC ((stmt_ty )asdl_seq_GET (stmts , i ));
3192- if (loc .lineno > 0 ) {
3193- return loc ;
3194- }
3195- }
3196- return NO_LOCATION ;
3197- }
3198-
31993187/* Code generated for "try: <body> finally: <finalbody>" is as follows:
32003188
32013189 SETUP_FINALLY L
@@ -3264,9 +3252,9 @@ compiler_try_finally(struct compiler *c, stmt_ty s)
32643252 RETURN_IF_ERROR (
32653253 compiler_push_fblock (c , loc , FINALLY_END , end , NO_LABEL , NULL ));
32663254 VISIT_SEQ (c , stmt , s -> v .Try .finalbody );
3267- loc = location_of_last_executing_statement (s -> v .Try .finalbody );
32683255 compiler_pop_fblock (c , FINALLY_END , end );
32693256
3257+ loc = NO_LOCATION ;
32703258 ADDOP_I (c , loc , RERAISE , 0 );
32713259
32723260 USE_LABEL (c , cleanup );
@@ -3315,9 +3303,9 @@ compiler_try_star_finally(struct compiler *c, stmt_ty s)
33153303 compiler_push_fblock (c , loc , FINALLY_END , end , NO_LABEL , NULL ));
33163304
33173305 VISIT_SEQ (c , stmt , s -> v .TryStar .finalbody );
3318- loc = location_of_last_executing_statement (s -> v .Try .finalbody );
33193306
33203307 compiler_pop_fblock (c , FINALLY_END , end );
3308+ loc = NO_LOCATION ;
33213309 ADDOP_I (c , loc , RERAISE , 0 );
33223310
33233311 USE_LABEL (c , cleanup );
0 commit comments