Don't generate spurious line number in try-except-finally. (#23760)

This commit is contained in:
Mark Shannon 2020-12-14 10:19:10 +00:00 • committed by GitHub
parent 674fa0a740
commit 56aa20f9eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1752 additions and 1733 deletions

View file

@ -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);