Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70b224d

Browse files
committed
assert than we never try to deal with True, False, or None as a name
1 parent 442f209 commit 70b224d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Python/compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
26352635
if (!mangled)
26362636
return 0;
26372637

2638+
assert(PyUnicode_CompareWithASCIIString(name, "None") &&
2639+
PyUnicode_CompareWithASCIIString(name, "True") &&
2640+
PyUnicode_CompareWithASCIIString(name, "False"));
2641+
26382642
op = 0;
26392643
optype = OP_NAME;
26402644
scope = PyST_GetScope(c->u->u_ste, mangled);

0 commit comments

Comments
 (0)