diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-03-17 20:41:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-03-17 20:41:42 (GMT) |
commit | 0dee9c1b5cba45c2a6c0320021f88397c559312e (patch) | |
tree | 9549f3be7acc89017dcbe30327792b846c846967 /Python | |
parent | 78c1871d2171b091d7249af63a4b5e3a927c0bc2 (diff) | |
download | cpython-0dee9c1b5cba45c2a6c0320021f88397c559312e.zip cpython-0dee9c1b5cba45c2a6c0320021f88397c559312e.tar.gz cpython-0dee9c1b5cba45c2a6c0320021f88397c559312e.tar.bz2 |
prevent lambda functions from having docstrings #8164
Diffstat (limited to 'Python')
-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 4ea2ee9..12210e1 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1518,6 +1518,11 @@ compiler_lambda(struct compiler *c, expr_ty e) /* unpack nested arguments */ compiler_arguments(c, args); + + /* 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); VISIT_IN_SCOPE(c, expr, e->v.Lambda.body); |