summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 27c3efaac8..42dcc2d826 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;