Skip to content

Commit 8358405

Browse files
committed
Call PyObject_GC_UnTrack before putting an object on the list of trash.
1 parent f589c05 commit 8358405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/traceback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ tb_getattr(tracebackobject *tb, char *name)
3535
static void
3636
tb_dealloc(tracebackobject *tb)
3737
{
38+
PyObject_GC_UnTrack(tb);
3839
Py_TRASHCAN_SAFE_BEGIN(tb)
39-
_PyObject_GC_UNTRACK(tb);
4040
Py_XDECREF(tb->tb_next);
4141
Py_XDECREF(tb->tb_frame);
4242
PyObject_GC_Del(tb);
@@ -120,7 +120,7 @@ newtracebackobject(tracebackobject *next, PyFrameObject *frame, int lasti,
120120
tb->tb_frame = frame;
121121
tb->tb_lasti = lasti;
122122
tb->tb_lineno = lineno;
123-
_PyObject_GC_TRACK(tb);
123+
PyObject_GC_Track(tb);
124124
}
125125
return tb;
126126
}

0 commit comments

Comments
 (0)