summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-03-15 14:24:25 (GMT)
committerGitHub <noreply@github.com>2021-03-15 14:24:25 (GMT)
commitc5440937efab6a99d54340c902dfb21e86874bc3 (patch)
tree5f9e2fdfb14ba0a400dc5ae32d1c699658b04e00 /Python
parent35d5068928ab5485e5f28b60b1e33062bc2c46cc (diff)
downloadcpython-c5440937efab6a99d54340c902dfb21e86874bc3.zip
cpython-c5440937efab6a99d54340c902dfb21e86874bc3.tar.gz
cpython-c5440937efab6a99d54340c902dfb21e86874bc3.tar.bz2
Mark POP_TOP at end of expression statement as artificial, to conform to PEP 626. (GH-24860)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 942614f..ea1bf6b 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3397,6 +3397,8 @@ compiler_visit_stmt_expr(struct compiler *c, expr_ty value)
}
VISIT(c, expr, value);
+ /* Mark POP_TOP as artificial */
+ c->u->u_lineno = -1;
ADDOP(c, POP_TOP);
return 1;
}