Skip to content

Commit b482f87

Browse files
Address reviews
1 parent 2e5667e commit b482f87

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Include/object.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,7 @@ _Py_IsOwnedByCurrentThread(PyObject *ob)
246246

247247
// bpo-39573: The Py_SET_TYPE() function must be used to set an object type.
248248
static inline PyTypeObject* Py_TYPE(PyObject *ob) {
249-
#ifdef Py_GIL_DISABLED
250-
return (PyTypeObject *)&ob->ob_type;
251-
#else
252249
return ob->ob_type;
253-
#endif
254250
}
255251
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
256252
# define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6600,7 +6600,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
66006600

66016601
PyTypeObject *oldto = Py_TYPE(self);
66026602
#ifdef Py_GIL_DISABLED
6603-
PyInterpreterState *interp = PyInterpreterState_Get();
6603+
PyInterpreterState *interp = _PyInterpreterState_GET();
66046604
// The real Py_TYPE(self) (`oldto`) may have changed from
66056605
// underneath us in another thread, so we re-fetch it here.
66066606
_PyEval_StopTheWorld(interp);

0 commit comments

Comments
 (0)