mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix handling of line numbers around finally-blocks. (#17737)
This commit is contained in:
parent
226e6e7d43
commit
88dce26da6
3 changed files with 1695 additions and 1625 deletions
|
@ -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
3250
Python/importlib.h
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue