diff Python/ast.c @ 41974:c8b0e3b8b456 legacy-trunk

Disallow function calls like foo(None=1). Backport from py3k rev. 55708 by Guido.
author Georg Brandl <georg@python.org>
date Thu, 07 Jun 2007 13:23:24 +0000
parents f19e631be101
children 6775ee6d89d3
line wrap: on
line diff
--- a/Python/ast.c	Wed Jun 06 20:19:19 2007 +0000
+++ b/Python/ast.c	Thu Jun 07 13:23:24 2007 +0000
@@ -1869,6 +1869,10 @@
                     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;