[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:
Łukasz Langa 2022-07-05 16:01:24 +02:00 committed by GitHub
parent 0615e7f9bb
commit 1bfe83a114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 25 deletions

View file

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