summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-18 17:24:29 (GMT)
committerGitHub <noreply@github.com>2021-01-18 17:24:29 (GMT)
commite232025025c8bd07c1d1b12a583a80c4a673f077 (patch)
tree4e933d341363bcefedf7ca25f51cd35549ac86d0 /Modules/faulthandler.c
parent998ae1fa3fb05a790071217cf8f6ae3a928da13f (diff)
downloadcpython-e232025025c8bd07c1d1b12a583a80c4a673f077.zip
cpython-e232025025c8bd07c1d1b12a583a80c4a673f077.tar.gz
cpython-e232025025c8bd07c1d1b12a583a80c4a673f077.tar.bz2
bpo-42923: Add Py_FatalError() test in test_capi (GH-24240)
Move faulthandler._fatal_error() to _testcapi.fatal_error().
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 67fe1ca..fe5dbc1 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1,6 +1,6 @@
#include "Python.h"
-#include "pycore_initconfig.h"
-#include "pycore_traceback.h"
+#include "pycore_initconfig.h" // _PyStatus_ERR
+#include "pycore_traceback.h" // _Py_DumpTracebackThreads
#include <signal.h>
#include <object.h>
#include <frameobject.h>
@@ -1123,25 +1123,6 @@ faulthandler_sigabrt(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
-static PyObject *
-faulthandler_fatal_error_py(PyObject *self, PyObject *args)
-{
- char *message;
- int release_gil = 0;
- if (!PyArg_ParseTuple(args, "y|i:fatal_error", &message, &release_gil))
- return NULL;
- faulthandler_suppress_crash_report();
- if (release_gil) {
- Py_BEGIN_ALLOW_THREADS
- Py_FatalError(message);
- Py_END_ALLOW_THREADS
- }
- else {
- Py_FatalError(message);
- }
- Py_RETURN_NONE;
-}
-
#if defined(FAULTHANDLER_USE_ALT_STACK)
#define FAULTHANDLER_STACK_OVERFLOW
@@ -1278,8 +1259,6 @@ static PyMethodDef module_methods[] = {
PyDoc_STR("_sigabrt(): raise a SIGABRT signal")},
{"_sigfpe", (PyCFunction)faulthandler_sigfpe, METH_NOARGS,
PyDoc_STR("_sigfpe(): raise a SIGFPE signal")},
- {"_fatal_error", faulthandler_fatal_error_py, METH_VARARGS,
- PyDoc_STR("_fatal_error(message): call Py_FatalError(message)")},
#ifdef FAULTHANDLER_STACK_OVERFLOW
{"_stack_overflow", faulthandler_stack_overflow, METH_NOARGS,
PyDoc_STR("_stack_overflow(): recursive call to raise a stack overflow")},