summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-06-07 13:23:24 (GMT)
committerGeorg Brandl <georg@python.org>2007-06-07 13:23:24 (GMT)
commite06cf4534f738f0ad4669f504fbde58bf8b3fb86 (patch)
tree2e037d4be486a07e6107f2bfd0eadb07a92c5b96 /Python
parentab8e279ba675eb399d278f3d14b6452c4c32db7d (diff)
downloadcpython-e06cf4534f738f0ad4669f504fbde58bf8b3fb86.zip
cpython-e06cf4534f738f0ad4669f504fbde58bf8b3fb86.tar.gz
cpython-e06cf4534f738f0ad4669f504fbde58bf8b3fb86.tar.bz2
Disallow function calls like foo(None=1).
Backport from py3k rev. 55708 by Guido.
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 27c3efa..42dcc2d 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1869,6 +1869,10 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
return NULL;
}
key = e->v.Name.id;
+ if (!strcmp(PyString_AS_STRING(key), "None")) {
+ ast_error(CHILD(ch, 0), "assignment to None");
+ return NULL;
+ }
e = ast_for_expr(c, CHILD(ch, 2));
if (!e)
return NULL;