summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-14 10:19:10 (GMT)
committerGitHub <noreply@github.com>2020-12-14 10:19:10 (GMT)
commit56aa20f9eb913c746b7d54b90be328c922639338 (patch)
treeed3564b0264bc9136174a9d44b6625d4b41847fa /Python/compile.c
parent674fa0a740151e0416c9383f127b16014e805990 (diff)
downloadcpython-56aa20f9eb913c746b7d54b90be328c922639338.zip
cpython-56aa20f9eb913c746b7d54b90be328c922639338.tar.gz
cpython-56aa20f9eb913c746b7d54b90be328c922639338.tar.bz2
Don't generate spurious line number in try-except-finally. (#23760)
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 ea9d678..241e8ff 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3007,6 +3007,8 @@ compiler_try_finally(struct compiler *c, stmt_ty s)
else {
VISIT_SEQ(c, stmt, s->v.Try.body);
}
+ /* Mark code as artificial */
+ c->u->u_lineno = -1;
ADDOP(c, POP_BLOCK);
compiler_pop_fblock(c, FINALLY_TRY, body);
VISIT_SEQ(c, stmt, s->v.Try.finalbody);