mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
gh-94485: Set line number of module's RESUME instruction to 0, as specified by PEP 626 (GH-94552)
Co-authored-by: Mark Shannon <mark@hotpy.org>
This commit is contained in:
parent
a2a3f2c541
commit
324d01944d
7 changed files with 33 additions and 26 deletions
|
@ -1759,7 +1759,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
|
|||
c->u->u_curblock = block;
|
||||
|
||||
if (u->u_scope_type == COMPILER_SCOPE_MODULE) {
|
||||
c->u->u_loc.lineno = -1;
|
||||
c->u->u_loc.lineno = 0;
|
||||
}
|
||||
else {
|
||||
if (!compiler_set_qualname(c))
|
||||
|
@ -1767,6 +1767,9 @@ compiler_enter_scope(struct compiler *c, identifier name,
|
|||
}
|
||||
ADDOP_I(c, RESUME, 0);
|
||||
|
||||
if (u->u_scope_type == COMPILER_SCOPE_MODULE) {
|
||||
c->u->u_loc.lineno = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue