]> granicus.if.org Git - python/commitdiff
assert than we never try to deal with True, False, or None as a name
authorBenjamin Peterson <benjamin@python.org>
Thu, 6 Dec 2012 22:49:58 +0000 (17:49 -0500)
committerBenjamin Peterson <benjamin@python.org>
Thu, 6 Dec 2012 22:49:58 +0000 (17:49 -0500)
Python/compile.c

index 3e960ccbfec0757c8ed42d613d23e61b3af7b13b..8f876a6d0d9635fde197de39941c7b32e69ad89c 100644 (file)
@@ -2635,6 +2635,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
     if (!mangled)
         return 0;
 
+    assert(PyUnicode_CompareWithASCIIString(name, "None") &&
+           PyUnicode_CompareWithASCIIString(name, "True") &&
+           PyUnicode_CompareWithASCIIString(name, "False"));
+
     op = 0;
     optype = OP_NAME;
     scope = PyST_GetScope(c->u->u_ste, mangled);