Skip to content

Commit c805603

Browse files
committed
Update comments
1 parent 235490e commit c805603

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Objects/capsule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ static void
287287
capsule_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
}

Python/gc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,9 +2201,8 @@ void
22012201
PyObject_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
}

Python/gc_free_threading.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,9 +2500,8 @@ void
25002500
PyObject_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
}

0 commit comments

Comments
 (0)