Skip to content
Merged
Prev Previous commit
Next Next commit
Py_TPFLAGS_METHOD_DESCRIPTOR is inherited if Py_TPFLAGS_IMMUTABLETYPE…
… is set
  • Loading branch information
Erlend E. Aasland committed Jul 2, 2021
commit dd42fdf14bd801663fb15400e52e1b84c835e758
4 changes: 2 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5915,8 +5915,8 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
* but only for extension types */
if (base->tp_descr_get &&
type->tp_descr_get == base->tp_descr_get &&
!(type->tp_flags & Py_TPFLAGS_HEAPTYPE) &&
(base->tp_flags & Py_TPFLAGS_METHOD_DESCRIPTOR))
_PyType_HasFeature(type, Py_TPFLAGS_IMMUTABLETYPE) &&
_PyType_HasFeature(base, Py_TPFLAGS_METHOD_DESCRIPTOR))
{
type->tp_flags |= Py_TPFLAGS_METHOD_DESCRIPTOR;
}
Expand Down