summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-17 20:56:58 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-17 20:56:58 (GMT)
commite6dd2cb63d6458b02eb31a4ca0a644aac2febc21 (patch)
tree994decb299233792e33776d80d6fd3ffe93826ac /Python
parent8fbddf15ea8ae342eee643cb5354d18cddc86dea (diff)
downloadcpython-e6dd2cb63d6458b02eb31a4ca0a644aac2febc21.zip
cpython-e6dd2cb63d6458b02eb31a4ca0a644aac2febc21.tar.gz
cpython-e6dd2cb63d6458b02eb31a4ca0a644aac2febc21.tar.bz2
Merged revisions 79034 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79034 | benjamin.peterson | 2010-03-17 15:41:42 -0500 (Wed, 17 Mar 2010) | 1 line prevent lambda functions from having docstrings #8164 ........
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c5
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);