From f0634b631bf32773a74f711444f56341151e541f Mon Sep 17 00:00:00 2001 From: Arendelle <2381642961@qq.com> Date: Tue, 26 Nov 2024 09:02:01 +0800 Subject: [PATCH] gh-127282: fix concurrent/future/thread.py: _python_exit relate to https://github.com/python/cpython/issues/127282 --- Lib/concurrent/futures/thread.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 909359b648709f..0bf2973bcffc74 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -28,7 +28,8 @@ def _python_exit(): for t, q in items: q.put(None) for t, q in items: - t.join() + while t.is_alive(): + t.join(timeout=2) # Register for `_python_exit()` to be called just before joining all # non-daemon threads. This is used instead of `atexit.register()` for