From 56aa20f9eb913c746b7d54b90be328c922639338 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Mon, 14 Dec 2020 10:19:10 +0000 Subject: Don't generate spurious line number in try-except-finally. (#23760) --- Python/compile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index ea9d6781b9..241e8ffd12 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); -- cgit v1.2.1