diff options
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index 2c58d44..62fa46c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1660,6 +1660,11 @@ compiler_lambda(struct compiler *c, expr_ty e) if (!compiler_enter_scope(c, name, (void *)e, e->lineno)) return 0; + /* Make None the first constant, so the lambda can't have a + docstring. */ + if (compiler_add_o(c, c->u->u_consts, Py_None) < 0) + return 0; + c->u->u_argcount = asdl_seq_LEN(args->args); c->u->u_kwonlyargcount = asdl_seq_LEN(args->kwonlyargs); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); |