diff options
author | Petr Viktorin <encukou@gmail.com> | 2025-04-28 13:48:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-28 13:48:48 (GMT) |
commit | 4ebbfcf30e0e2d87ff6036d4d1de0f6f0ef7c46a (patch) | |
tree | bd04a48591c2bc6fc6df81c0c4ab8e27addeba4d /Python/fileutils.c | |
parent | 995b1a72f20e4b0bc44b6471d40c2c368d74efb1 (diff) | |
download | cpython-4ebbfcf30e0e2d87ff6036d4d1de0f6f0ef7c46a.zip cpython-4ebbfcf30e0e2d87ff6036d4d1de0f6f0ef7c46a.tar.gz cpython-4ebbfcf30e0e2d87ff6036d4d1de0f6f0ef7c46a.tar.bz2 |
gh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh-130402)
If `Py_IsFinalizing()` is true, non-daemon threads (other than the current one)
are done, and daemon threads are prevented from running, so they
cannot finalize themselves and become done. Joining them (without timeout)
would block forever.
Raise PythonFinalizationError instead of hanging.
Raise even when a timeout is given, for consistency with trying to join your own thread.
See gh-123940 for a use case: calling `join()` from `__del__`. This is
ill-advised, but an exception should at least make it easier to diagnose.
Diffstat (limited to 'Python/fileutils.c')
0 files changed, 0 insertions, 0 deletions