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

Skip to content

Commit bdbb395

Browse files
committed
Looks like an oopsie -- I ignored a warning at my peril.
1 parent f903f00 commit bdbb395

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2972,7 +2972,8 @@ expr_constant(expr_ty e)
29722972
return PyObject_IsTrue(e->v.Str.s);
29732973
case Name_kind:
29742974
/* optimize away names that can't be reassigned */
2975-
id = _PyUnicode_AsDefaultEncodedString(e->v.Name.id, NULL);
2975+
id = PyString_AS_STRING(
2976+
_PyUnicode_AsDefaultEncodedString(e->v.Name.id, NULL));
29762977
if (strcmp(id, "True") == 0) return 1;
29772978
if (strcmp(id, "False") == 0) return 0;
29782979
if (strcmp(id, "None") == 0) return 0;

0 commit comments

Comments
 (0)