Skip to content

Commit

Permalink
PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Feb 2, 2025
1 parent 82845c3 commit d13be64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ extern "C" inline int pybind11_clear(PyObject *self) {
inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {
auto *type = &heap_type->ht_type;
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
#if PY_VERSION_HEX < 0x030B0000
#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION)
type->tp_dictoffset = type->tp_basicsize; // place dict at the end
type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
#else
Expand Down

0 comments on commit d13be64

Please sign in to comment.