Mark POP_TOP at end of expression statement as artificial, to conform to PEP 626. (GH-24860)

This commit is contained in:
Mark Shannon 2021-03-15 14:24:25 +00:00 committed by GitHub
parent 35d5068928
commit c5440937ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

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