summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-11-10 22:40:34 (GMT)
committerGuido van Rossum <guido@python.org>1994-11-10 22:40:34 (GMT)
commit363ac7d5b6513e68b61008e2867ef23886e70619 (patch)
tree3bc6a853f4f2f1ecc0558f699dd6e4c9de6b00dd /Python/compile.c
parent13d0ed13c360c09d97ab226562ec6b8ec93290d4 (diff)
downloadcpython-363ac7d5b6513e68b61008e2867ef23886e70619.zip
cpython-363ac7d5b6513e68b61008e2867ef23886e70619.tar.gz
cpython-363ac7d5b6513e68b61008e2867ef23886e70619.tar.bz2
set name to <lambda> instead of None for lambdas
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/compile.c b/Python/compile.c
index d813400..b3b610a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2274,7 +2274,7 @@ compile_lambdef(c, n)
{
node *ch;
REQ(n, lambdef); /* lambdef: 'lambda' [parameters] ':' test */
- c->c_name = NULL;
+ c->c_name = "<lambda>";
ch = CHILD(n, 1);
if (TYPE(ch) == COLON) {
@@ -2515,12 +2515,7 @@ compile(n, filename)
if (sc.c_errors == 0) {
object *v, *w;
v = newstringobject(sc.c_filename);
- if (sc.c_name)
- w = newstringobject(sc.c_name);
- else {
- INCREF(None);
- w = None;
- }
+ w = newstringobject(sc.c_name);
if (v != NULL && w != NULL)
co = newcodeobject(sc.c_code, sc.c_consts,
sc.c_names, v, w);