summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-11 16:22:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-11 16:22:29 (GMT)
commit91427733ea26a72a987d66db202ed4ddbb95805f (patch)
tree1952b7a298ab28ea2190a9facb13a8ab30462936 /Python/compile.c
parent354ecf1ef2283434600a12cf544da6df679d03d9 (diff)
parentc775ad615a6370ec8424422422bbec3f0976428b (diff)
downloadcpython-91427733ea26a72a987d66db202ed4ddbb95805f.zip
cpython-91427733ea26a72a987d66db202ed4ddbb95805f.tar.gz
cpython-91427733ea26a72a987d66db202ed4ddbb95805f.tar.bz2
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 97fe5c2..d5009e1 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);