Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash when faulthandler is imported more than once.
15 changes: 0 additions & 15 deletions Modules/faulthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,20 +1248,6 @@ faulthandler_stack_overflow(PyObject *self, PyObject *Py_UNUSED(ignored))
#endif /* defined(FAULTHANDLER_USE_ALT_STACK) && defined(HAVE_SIGACTION) */


static int
faulthandler_traverse(PyObject *module, visitproc visit, void *arg)
{
Py_VISIT(thread.file);
#ifdef FAULTHANDLER_USER
if (user_signals != NULL) {
for (size_t signum=0; signum < Py_NSIG; signum++)
Py_VISIT(user_signals[signum].file);
}
#endif
Py_VISIT(fatal_error.file);
return 0;
}

#ifdef MS_WINDOWS
static PyObject *
faulthandler_raise_exception(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -1394,7 +1380,6 @@ static struct PyModuleDef module_def = {
.m_name = "faulthandler",
.m_doc = module_doc,
.m_methods = module_methods,
.m_traverse = faulthandler_traverse,
.m_slots = faulthandler_slots
};

Expand Down
Loading