mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109)
This commit is contained in:
parent
f572cbf1fa
commit
e5862f79c1
3 changed files with 27 additions and 5 deletions
|
@ -3312,11 +3312,11 @@ compiler_try_except(struct compiler *c, stmt_ty s)
|
|||
/* second # body */
|
||||
VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body);
|
||||
compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body);
|
||||
/* name = None; del name; # Mark as artificial */
|
||||
UNSET_LOC(c);
|
||||
ADDOP(c, POP_BLOCK);
|
||||
ADDOP(c, POP_BLOCK);
|
||||
ADDOP(c, POP_EXCEPT);
|
||||
/* name = None; del name; # Mark as artificial */
|
||||
UNSET_LOC(c);
|
||||
ADDOP_LOAD_CONST(c, Py_None);
|
||||
compiler_nameop(c, handler->v.ExceptHandler.name, Store);
|
||||
compiler_nameop(c, handler->v.ExceptHandler.name, Del);
|
||||
|
@ -3348,7 +3348,6 @@ compiler_try_except(struct compiler *c, stmt_ty s)
|
|||
return 0;
|
||||
VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body);
|
||||
compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body);
|
||||
/* name = None; del name; # Mark as artificial */
|
||||
UNSET_LOC(c);
|
||||
ADDOP(c, POP_BLOCK);
|
||||
ADDOP(c, POP_EXCEPT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue