We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98e50b7 commit 35f9d97Copy full SHA for 35f9d97
1 file changed
include/pybind11/detail/class.h
@@ -578,7 +578,10 @@ inline PyObject *make_object_base_type(PyTypeObject *metaclass) {
578
/// dynamic_attr: Allow the garbage collector to traverse the internal instance `__dict__`.
579
extern "C" inline int pybind11_traverse(PyObject *self, visitproc visit, void *arg) {
580
#if PY_VERSION_HEX >= 0x030D0000
581
- PyObject_VisitManagedDict(self, visit, arg);
+ int vret = PyObject_VisitManagedDict(self, visit, arg);
582
+ if (vret) {
583
+ return vret;
584
+ }
585
#else
586
PyObject *&dict = *_PyObject_GetDictPtr(self);
587
Py_VISIT(dict);
0 commit comments