Skip to content

Commit

Permalink
Sync Py_TPFLAGS_MANAGED_DICT for PyPy3.11 across the codebase
Browse files Browse the repository at this point in the history
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 #5508.
  • Loading branch information
mgorny committed Feb 20, 2025
1 parent b7c3300 commit 2026df3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ struct type_record {

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

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

0 comments on commit 2026df3

Please sign in to comment.