give a py3k warning when 'nonlocal' is used as a variable name
diff --git a/Python/ast.c b/Python/ast.c
index 8414c74..29b0e82 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -131,9 +131,14 @@
{
if (!strcmp(x, "None"))
return ast_error(n, "assignment to None");
- if (Py_Py3kWarningFlag && !(strcmp(x, "True") && strcmp(x, "False")) &&
- !ast_warn(c, n, "assignment to True or False is forbidden in 3.x"))
- return 0;
+ if (Py_Py3kWarningFlag) {
+ if (!(strcmp(x, "True") && strcmp(x, "False")) &&
+ !ast_warn(c, n, "assignment to True or False is forbidden in 3.x"))
+ return 0;
+ if (!strcmp(x, "nonlocal") &&
+ !ast_warn(c, n, "nonlocal is a keyword in 3.x"))
+ return 0;
+ }
return 1;
}