From 064e80f339d2e7633e05be75767273e6463158a8 Mon Sep 17 00:00:00 2001 From: Bruno Cauet Date: Mon, 2 Mar 2015 11:29:00 +0100 Subject: [PATCH 1/2] lambda generators: don't throw away stack top Fix issue #23192. --- Python/compile.c | 4 ++-- 1 file 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); -- 2.3.1