mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
* Replace id->object with _PyUnicode_FromId(&id) * Use _Py_static_string_init(str) macro to initialize statically name_op in typeobject.c.
This commit is contained in:
parent
27c0d9b54a
commit
4804b5b3df
4 changed files with 11 additions and 11 deletions
|
@ -4414,7 +4414,7 @@ special_lookup(PyThreadState *tstate, PyObject *o, _Py_Identifier *id)
|
|||
PyObject *res;
|
||||
res = _PyObject_LookupSpecial(o, id);
|
||||
if (res == NULL && !_PyErr_Occurred(tstate)) {
|
||||
_PyErr_SetObject(tstate, PyExc_AttributeError, id->object);
|
||||
_PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(id));
|
||||
return NULL;
|
||||
}
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue