File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,9 @@ static void
287287capsule_dealloc (PyObject * op )
288288{
289289 PyCapsule * capsule = _PyCapsule_CAST (op );
290- PyObject_GC_UnTrack (op );
290+ if (_PyObject_GC_IS_TRACKED (op )) {
291+ PyObject_GC_UnTrack (op );
292+ }
291293 if (capsule -> destructor ) {
292294 capsule -> destructor (op );
293295 }
Original file line number Diff line number Diff line change @@ -2201,9 +2201,8 @@ void
22012201PyObject_GC_UnTrack (void * op_raw )
22022202{
22032203 PyObject * op = _PyObject_CAST (op_raw );
2204- /* Obscure: the trashcan mechanism requires that we be able to
2205- * call PyObject_GC_UnTrack twice on an object.
2206- */
2204+ /* The code for some objects, such as tuples, is a bit
2205+ * sloppy about when the object is tracked and untracked. */
22072206 if (_PyObject_GC_IS_TRACKED (op )) {
22082207 _PyObject_GC_UNTRACK (op );
22092208 }
Original file line number Diff line number Diff line change @@ -2500,9 +2500,8 @@ void
25002500PyObject_GC_UnTrack (void * op_raw )
25012501{
25022502 PyObject * op = _PyObject_CAST (op_raw );
2503- /* Obscure: the trashcan mechanism requires that we be able to
2504- * call PyObject_GC_UnTrack twice on an object.
2505- */
2503+ /* The code for some objects, such as tuples, is a bit
2504+ * sloppy about when the object is tracked and untracked. */
25062505 if (_PyObject_GC_IS_TRACKED (op )) {
25072506 _PyObject_GC_UNTRACK (op );
25082507 }
You can’t perform that action at this time.
0 commit comments