diff options
author | Mark Shannon <mark@hotpy.org> | 2021-07-14 09:08:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 09:08:38 (GMT) |
commit | e5862f79c16e28f1ec51d179698739a9b2d8c1d2 (patch) | |
tree | 7bc78c01297940c15efcdf7bdbc5bf6bcc7cac77 /Python | |
parent | f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6 (diff) | |
download | cpython-e5862f79c16e28f1ec51d179698739a9b2d8c1d2.zip cpython-e5862f79c16e28f1ec51d179698739a9b2d8c1d2.tar.gz cpython-e5862f79c16e28f1ec51d179698739a9b2d8c1d2.tar.bz2 |
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 5 | ||||
-rw-r--r-- | Python/importlib_zipimport.h | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c index bb5c2ec..81648c5 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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); diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index d4ba6ee..15ad71f 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -1403,8 +1403,8 @@ const unsigned char _Py_M__zipimport[] = { 23,35,13,20,20,29,30,34,30,42,44,53,20,54,13,17, 20,24,13,17,16,26,13,54,17,39,28,43,44,48,50,57, 59,67,69,77,79,83,28,84,21,25,21,25,0,0,17,39, - 24,35,17,39,17,39,17,39,17,39,36,39,21,33,21,39, - 21,39,21,39,21,39,21,39,0,0,0,0,0,0,0,0, + 24,35,17,39,17,39,17,39,17,39,36,39,21,33,21,33, + 21,33,21,33,21,33,21,33,0,0,0,0,0,0,0,0, 0,0,24,39,40,47,49,53,24,54,17,21,16,20,24,28, 16,28,13,25,17,25,23,32,33,34,23,35,13,20,20,24, 26,35,37,44,20,44,13,44,13,44,13,44,12,24,9,83, |