diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-11 16:20:35 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-11 16:20:35 (GMT) |
commit | c775ad615a6370ec8424422422bbec3f0976428b (patch) | |
tree | 44ae0e24459750d4f01cc2b5ffc9e03c9fc8b9b5 /Python/compile.c | |
parent | cf4a2f29adb6bdae0b18e983250d7c48d486c9d6 (diff) | |
download | cpython-c775ad615a6370ec8424422422bbec3f0976428b.zip cpython-c775ad615a6370ec8424422422bbec3f0976428b.tar.gz cpython-c775ad615a6370ec8424422422bbec3f0976428b.tar.bz2 |
Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index b07c156..3d7152c 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); |