Skip to content

Commit f10c2fd

Browse files
committed
Undo attr.h, detail/class.h changes made under PR pybind#3923. See python/cpython#92678 for background.
1 parent 2d59b43 commit f10c2fd

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

include/pybind11/attr.h

-4
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

-4
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,8 @@ extern "C" inline int pybind11_clear(PyObject *self) {
524524
inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {
525525
auto *type = &heap_type->ht_type;
526526
type->tp_flags |= Py_TPFLAGS_HAVE_GC;
527-
#if PY_VERSION_HEX < 0x030B0000
528527
type->tp_dictoffset = type->tp_basicsize; // place dict at the end
529528
type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
530-
#else
531-
type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
532-
#endif
533529
type->tp_traverse = pybind11_traverse;
534530
type->tp_clear = pybind11_clear;
535531

0 commit comments

Comments
 (0)