diff options
author | Victor Stinner <vstinner@python.org> | 2024-02-14 22:35:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 22:35:06 (GMT) |
commit | 3e7b7df5cbaad5617cc28f0c005010787c48e6d6 (patch) | |
tree | 3ce4371899be9adafac100da28b30b30884e7af9 /Modules/_winapi.c | |
parent | 326119d3731f784aa9f5d4afa7b687dd1ab1d916 (diff) | |
download | cpython-3e7b7df5cbaad5617cc28f0c005010787c48e6d6.zip cpython-3e7b7df5cbaad5617cc28f0c005010787c48e6d6.tar.gz cpython-3e7b7df5cbaad5617cc28f0c005010787c48e6d6.tar.bz2 |
gh-114570: Add PythonFinalizationError exception (#115352)
Add PythonFinalizationError exception. This exception derived from
RuntimeError is raised when an operation is blocked during the Python
finalization.
The following functions now raise PythonFinalizationError, instead of
RuntimeError:
* _thread.start_new_thread()
* subprocess.Popen
* os.fork()
* os.fork1()
* os.forkpty()
Morever, _winapi.Overlapped finalizer now logs an unraisable
PythonFinalizationError, instead of an unraisable RuntimeError.
Diffstat (limited to 'Modules/_winapi.c')
-rw-r--r-- | Modules/_winapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_winapi.c b/Modules/_winapi.c index 83a4ccd..8f9b852 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -139,7 +139,7 @@ overlapped_dealloc(OverlappedObject *self) { /* The operation is still pending -- give a warning. This will probably only happen on Windows XP. */ - PyErr_SetString(PyExc_RuntimeError, + PyErr_SetString(PyExc_PythonFinalizationError, "I/O operations still in flight while destroying " "Overlapped object, the process may crash"); PyErr_WriteUnraisable(NULL); |