summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-11 18:20:35 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-11 18:20:35 +0200
commit032f46c1b687d0b558e28d849d1895b910b0388d (patch)
treebc28f9b4069a1b189ae74624093da485ad272d88 /Python/compile.c
parent8617749719e312b9298a78180ae4cb0120c5056b (diff)
downloadcpython-032f46c1b687d0b558e28d849d1895b910b0388d.tar.gz
Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index b07c15647e..3d7152cd28 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1897,12 +1897,12 @@ compiler_lambda(struct compiler *c, expr_ty e)
c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs);
VISIT_IN_SCOPE(c, expr, e->v.Lambda.body);
if (c->u->u_ste->ste_generator) {
- ADDOP_IN_SCOPE(c, POP_TOP);
+ co = assemble(c, 0);
}
else {
ADDOP_IN_SCOPE(c, RETURN_VALUE);
+ co = assemble(c, 1);
}
- co = assemble(c, 1);
qualname = c->u->u_qualname;
Py_INCREF(qualname);
compiler_exit_scope(c);