Skip to content

Commit

Permalink
Accept thread unsafety when checking subtype for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Mar 29, 2024
1 parent 491e4ff commit 531a076
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,14 +2333,7 @@ is_subtype_with_mro(PyObject *a_mro, PyTypeObject *a, PyTypeObject *b)
int
PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
{
#ifdef Py_GIL_DISABLED
PyObject *mro = _PyType_GetMRO(a);
int res = is_subtype_with_mro(mro, a, b);
Py_XDECREF(mro);
return res;
#else
return is_subtype_with_mro(lookup_tp_mro(a), a, b);
#endif
return is_subtype_with_mro(a->tp_mro, a, b);
}

/* Routines to do a method lookup in the type without looking in the
Expand Down

0 comments on commit 531a076

Please sign in to comment.