@@ -288,7 +288,10 @@ The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:
288288 :c:member:`~PyTypeObject.tp_flags` field, the traverse function must call
289289 :c:func:`PyObject_VisitManagedDict` like this::
290290
291- PyObject_VisitManagedDict((PyObject*)self, visit, arg);
291+ int err = PyObject_VisitManagedDict((PyObject*)self, visit, arg);
292+ if (err) {
293+ return err;
294+ }
292295
293296 Only the members that the instance *owns * (by having
294297 :term: `strong references <strong reference> ` to them) must be
@@ -382,14 +385,14 @@ The following functions and macros are safe to use in a
382385"DuringGC" functions
383386^^^^^^^^^^^^^^^^^^^^
384387
385- The following functions should *only * used in a
388+ The following functions should *only * be used in a
386389:c:member: `~PyTypeObject.tp_traverse ` handler; calling them in other
387390contexts may have unintended consequences.
388391
389392These functions act like their counterparts without the ``_DuringGC `` suffix,
390393but they are guaranteed to not have side effects, they do not set an exception
391394on failure, and they return/set :term: `borrowed references <borrowed reference> `
392- as detailed in the individual documentation..
395+ as detailed in the individual documentation.
393396
394397Note that these functions may fail (return ``NULL `` or ``-1 ``),
395398but as they do not set an exception, no error information is available.
0 commit comments