Skip to content

Commit

Permalink
Undo attr.h, detail/class.h changes made under PR pybind#3923. See py…
Browse files Browse the repository at this point in the history
…thon/cpython#92678 for background.
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Aug 17, 2022
1 parent 2d59b43 commit f10c2fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions include/pybind11/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,7 @@ struct type_record {

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

#if PY_VERSION_HEX < 0x030B0000
dynamic_attr |= base_info->type->tp_dictoffset != 0;
#else
dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0;
#endif

if (caster) {
base_info->implicit_casts.emplace_back(type, caster);
Expand Down
4 changes: 0 additions & 4 deletions include/pybind11/detail/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,8 @@ 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
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
type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
#endif
type->tp_traverse = pybind11_traverse;
type->tp_clear = pybind11_clear;

Expand Down

0 comments on commit f10c2fd

Please sign in to comment.