Fix handling of line numbers around finally-blocks. (#17737)

This commit is contained in:
Mark Shannon 2019-12-30 09:53:36 +00:00 committed by GitHub
parent 226e6e7d43
commit 88dce26da6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1695 additions and 1625 deletions

View file

@ -1686,7 +1686,11 @@ compiler_unwind_fblock(struct compiler *c, struct fblockinfo *info,
return 0;
}
}
/* Emit the finally block, restoring the line number when done */
int saved_lineno = c->u->u_lineno;
VISIT_SEQ(c, stmt, info->fb_datum);
c->u->u_lineno = saved_lineno;
c->u->u_lineno_set = 0;
if (preserve_tos) {
compiler_pop_fblock(c, POP_VALUE, NULL);
}

3250
Python/importlib.h generated

File diff suppressed because it is too large Load diff