From 58bd699c3f05b7651b161581fd6a5703ad97d0ab Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 19:05:29 +0800 Subject: [PATCH] fix: allow gracefully exit of workers when killed --- module/device/method/pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/device/method/pool.py b/module/device/method/pool.py index 95590cd..8d6cf38 100644 --- a/module/device/method/pool.py +++ b/module/device/method/pool.py @@ -239,7 +239,7 @@ class WorkerThread: res = ctypes.pythonapi.PyThreadState_SetAsyncExc( thread_id, ctypes.py_object(_JobKill)) if res <= 1: - del self.thread_pool.all_workers[self] + self.thread_pool.all_workers.pop(self, None) self.thread_pool.release_full_lock() return True else: