Skip to content

Commit 790e44e

Browse files
committed
Undo attr.h, detail/class.h changes made under PR pybind#3923. See python/cpython#92678 for background.
1 parent 29f4940 commit 790e44e

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

include/pybind11/attr.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,7 @@ struct type_record {
345345

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

348-
#if PY_VERSION_HEX < 0x030B0000
349348
dynamic_attr |= base_info->type->tp_dictoffset != 0;
350-
#else
351-
dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0;
352-
#endif
353349

354350
if (caster) {
355351
base_info->implicit_casts.emplace_back(type, caster);

include/pybind11/detail/class.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,8 @@ extern "C" inline int pybind11_clear(PyObject *self) {
549549
inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {
550550
auto *type = &heap_type->ht_type;
551551
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
552-
#if PY_VERSION_HEX < 0x030B0000
553552
type->tp_dictoffset = type->tp_basicsize; // place dict at the end
554553
type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
555-
#else
556-
type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
557-
#endif
558554
type->tp_traverse = pybind11_traverse;
559555
type->tp_clear = pybind11_clear;
560556

0 commit comments

Comments
 (0)