mirror of
https://github.com/python/cpython
synced 2026-09-29 09:40:29 +03:00
PyString_AsString is permissive and accepts unicode strings.
Replace it with PyUnicode_AsString when the argument is known to be a str.
This commit is contained in:
parent
484fcd4521
commit
39599dca9d
5 changed files with 9 additions and 9 deletions
|
|
@ -407,7 +407,7 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
|
|||
case LOAD_NAME:
|
||||
case LOAD_GLOBAL:
|
||||
j = GETARG(codestr, i);
|
||||
name = PyString_AsString(PyTuple_GET_ITEM(names, j));
|
||||
name = PyUnicode_AsString(PyTuple_GET_ITEM(names, j));
|
||||
h = load_global(codestr, i, name, consts);
|
||||
if (h < 0)
|
||||
goto exitUnchanged;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue