diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index 5ae1e34..7717689 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; } |