Skip to content

Commit 2026df3

Browse files
committed
Sync Py_TPFLAGS_MANAGED_DICT for PyPy3.11 across the codebase
Adjust the `Py_TPFLAGS_MANAGED_DICT` logic in `include/pybind11/attr.h` to match the one used in `include/pybind11/detail/class.h`. This is a followup to pybind#5508.
1 parent b7c3300 commit 2026df3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/pybind11/attr.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ struct type_record {
359359

360360
bases.append((PyObject *) base_info->type);
361361

362-
#if PY_VERSION_HEX < 0x030B0000
362+
// Keep in sync with enable_dynamic_attributes() in detail/class.h
363+
#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION)
363364
dynamic_attr |= base_info->type->tp_dictoffset != 0;
364365
#else
365366
dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0;

0 commit comments

Comments
 (0)