From d2e2e53f733f8c8098035bbbc452bd1892796cb3 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Thu, 27 Apr 2023 16:19:43 -0600 Subject: 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. --- Objects/classobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Objects/classobject.c') diff --git a/Objects/classobject.c b/Objects/classobject.c index 2cb192e725..71c4a4e5d0 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -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; } -- cgit v1.2.1