mirror of
https://github.com/python/cpython.git
synced 2025-07-12 22:05:16 +00:00
bpo-31393: Fix the use of PyUnicode_READY(). (#3451)
This commit is contained in:
parent
70c2dd306f
commit
e3b2b4b8d9
5 changed files with 30 additions and 14 deletions
|
@ -5017,13 +5017,16 @@ import_all_from(PyObject *locals, PyObject *v)
|
|||
PyErr_Clear();
|
||||
break;
|
||||
}
|
||||
if (skip_leading_underscores &&
|
||||
PyUnicode_Check(name) &&
|
||||
PyUnicode_READY(name) != -1 &&
|
||||
PyUnicode_READ_CHAR(name, 0) == '_')
|
||||
{
|
||||
Py_DECREF(name);
|
||||
continue;
|
||||
if (skip_leading_underscores && PyUnicode_Check(name)) {
|
||||
if (PyUnicode_READY(name) == -1) {
|
||||
Py_DECREF(name);
|
||||
err = -1;
|
||||
break;
|
||||
}
|
||||
if (PyUnicode_READ_CHAR(name, 0) == '_') {
|
||||
Py_DECREF(name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
value = PyObject_GetAttr(v, name);
|
||||
if (value == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue