mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)
There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.
This commit is contained in:
parent
56c7176d1d
commit
d2e2e53f73
21 changed files with 89 additions and 169 deletions
|
@ -181,7 +181,7 @@ method_getattro(PyObject *obj, PyObject *name)
|
|||
PyObject *descr = NULL;
|
||||
|
||||
{
|
||||
if (tp->tp_dict == NULL) {
|
||||
if (!_PyType_IsReady(tp)) {
|
||||
if (PyType_Ready(tp) < 0)
|
||||
return NULL;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ instancemethod_getattro(PyObject *self, PyObject *name)
|
|||
PyTypeObject *tp = Py_TYPE(self);
|
||||
PyObject *descr = NULL;
|
||||
|
||||
if (tp->tp_dict == NULL) {
|
||||
if (!_PyType_IsReady(tp)) {
|
||||
if (PyType_Ready(tp) < 0)
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue