File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -574,9 +574,9 @@ extern "C" inline int pybind11_clear(PyObject *self) {
574
574
inline void enable_dynamic_attributes (PyHeapTypeObject *heap_type) {
575
575
auto *type = &heap_type->ht_type ;
576
576
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
577
- #if PY_VERSION_HEX < 0x030B0000
578
- type->tp_dictoffset = type->tp_basicsize ; // place dict at the end
579
- type->tp_basicsize += (ssize_t ) sizeof (PyObject *); // and allocate enough space for it
577
+ #if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION) // For PyPy see PR #5508
578
+ type->tp_dictoffset = type->tp_basicsize ; // place dict at the end
579
+ type->tp_basicsize += (ssize_t ) sizeof (PyObject *); // and allocate enough space for it
580
580
#else
581
581
type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
582
582
#endif
You can’t perform that action at this time.
0 commit comments