diff options
author | Victor Stinner <vstinner@python.org> | 2021-01-18 20:47:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 20:47:13 +0100 |
commit | 250035d134ad482e724f73ce654682254b513ee0 (patch) | |
tree | 48d2b3627adfe0b0e04aaaee25f35f4999cde254 /Include | |
parent | bpo-42944 Fix Random.sample when counts is not None (GH-24235) (diff) | |
download | cpython-250035d134ad482e724f73ce654682254b513ee0.tar.gz cpython-250035d134ad482e724f73ce654682254b513ee0.tar.bz2 cpython-250035d134ad482e724f73ce654682254b513ee0.zip |
bpo-42923: Dump extension modules on fatal error (GH-24207)
The Py_FatalError() function and the faulthandler module now dump the
list of extension modules on a fatal error.
Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal
functions.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_pyerrors.h | 2 | ||||
-rw-r--r-- | Include/moduleobject.h | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Include/internal/pycore_pyerrors.h b/Include/internal/pycore_pyerrors.h index 2cf1160afc0..9dd66aec9c3 100644 --- a/Include/internal/pycore_pyerrors.h +++ b/Include/internal/pycore_pyerrors.h @@ -84,6 +84,8 @@ PyAPI_FUNC(PyObject *) _PyErr_FormatFromCauseTstate( PyAPI_FUNC(int) _PyErr_CheckSignalsTstate(PyThreadState *tstate); +PyAPI_FUNC(void) _Py_DumpExtensionModules(int fd, PyInterpreterState *interp); + #ifdef __cplusplus } #endif diff --git a/Include/moduleobject.h b/Include/moduleobject.h index cf9ad40c0a1..49b116ca1c3 100644 --- a/Include/moduleobject.h +++ b/Include/moduleobject.h @@ -84,6 +84,12 @@ typedef struct PyModuleDef{ freefunc m_free; } PyModuleDef; + +// Internal C API +#ifdef Py_BUILD_CORE +extern int _PyModule_IsExtension(PyObject *obj); +#endif + #ifdef __cplusplus } #endif |