mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
[3.11] gh-94485: Set line number of module's RESUME instruction to 0 as specified by PEP 626 (GH-94552) (GH-94562)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Mark Shannon <mark@hotpy.org>
(cherry picked from commit 324d01944d
)
This commit is contained in:
parent
0615e7f9bb
commit
1bfe83a114
7 changed files with 32 additions and 25 deletions
|
@ -1803,7 +1803,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_lineno = -1;
|
||||
c->u->u_lineno = 0;
|
||||
}
|
||||
else {
|
||||
if (!compiler_set_qualname(c))
|
||||
|
@ -1811,6 +1811,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_lineno = -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue