Skip to content

Commit 13cec08

Browse files
acquire critical section around tb_next
1 parent 0408481 commit 13cec08

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/traceback.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ traceback_tb_next_set_impl(PyTracebackObject *self, PyObject *value)
172172
PyErr_Format(PyExc_ValueError, "traceback loop detected");
173173
return -1;
174174
}
175+
Py_BEGIN_CRITICAL_SECTION(cursor);
175176
cursor = cursor->tb_next;
177+
Py_END_CRITICAL_SECTION();
176178
}
177179

178180
Py_XSETREF(self->tb_next, (PyTracebackObject *)Py_XNewRef(value));

0 commit comments

Comments
 (0)