diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-26 19:33:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-26 19:33:59 (GMT) |
commit | ae1d99c2ed9d44b2554129f3a85b97a31119bccc (patch) | |
tree | 22fabe9a7b4e9a779c0e12aefa08cec7f356571e | |
parent | fbfec5642edd9d7690bbff088ee43c08e8067044 (diff) | |
download | cpython-ae1d99c2ed9d44b2554129f3a85b97a31119bccc.zip cpython-ae1d99c2ed9d44b2554129f3a85b97a31119bccc.tar.gz cpython-ae1d99c2ed9d44b2554129f3a85b97a31119bccc.tar.bz2 |
Remove concurrent.futures deadcode: process_result_item() (#109906)
process_result_item() cannot be called with an int anymore, the
protocol changed.
-rw-r--r-- | Lib/concurrent/futures/process.py | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 011e79a..73bdcbe 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -444,24 +444,14 @@ class _ExecutorManagerThread(threading.Thread): # Process the received a result_item. This can be either the PID of a # worker that exited gracefully or a _ResultItem - if isinstance(result_item, int): - # Clean shutdown of a worker using its PID - # (avoids marking the executor broken) - assert self.is_shutting_down() - p = self.processes.pop(result_item) - p.join() - if not self.processes: - self.join_executor_internals() - return - else: - # Received a _ResultItem so mark the future as completed. - work_item = self.pending_work_items.pop(result_item.work_id, None) - # work_item can be None if another process terminated (see above) - if work_item is not None: - if result_item.exception: - work_item.future.set_exception(result_item.exception) - else: - work_item.future.set_result(result_item.result) + # Received a _ResultItem so mark the future as completed. + work_item = self.pending_work_items.pop(result_item.work_id, None) + # work_item can be None if another process terminated (see above) + if work_item is not None: + if result_item.exception: + work_item.future.set_exception(result_item.exception) + else: + work_item.future.set_result(result_item.result) def is_shutting_down(self): # Check whether we should start shutting down the executor. |