summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-21 13:53:50 (GMT)
committerGitHub <noreply@github.com>2020-12-21 13:53:50 (GMT)
commitf2dbfd7e20431f0bcf2b655aa876afec7fe03c6f (patch)
treef56aebc70e3cc671bb96cd19d3fc0adc7988769c /Python/compile.c
parentd515c610c61b9a8c40c037a3dc3bfc8d67563658 (diff)
downloadcpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.zip
cpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.tar.gz
cpython-f2dbfd7e20431f0bcf2b655aa876afec7fe03c6f.tar.bz2
bpo-42634: Mark reraise after except blocks as artificial. (GH-23877)
* Mark reraise after except blocks as artificial. * Update importlib * Update dis test.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index d4dbaf7..6698b55 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3129,6 +3129,8 @@ compiler_try_except(struct compiler *c, stmt_ty s)
compiler_use_next_block(c, except);
}
compiler_pop_fblock(c, EXCEPTION_HANDLER, NULL);
+ /* Mark as artificial */
+ c->u->u_lineno = -1;
ADDOP_I(c, RERAISE, 0);
compiler_use_next_block(c, orelse);
VISIT_SEQ(c, stmt, s->v.Try.orelse);