mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-43498: Fix dictionary iteration error in _ExecutorManagerThread (GH-24868)
(cherry picked from commit 7431448b81
)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
This commit is contained in:
parent
4d2cc3ed46
commit
4b11d71185
2 changed files with 3 additions and 1 deletions
|
@ -373,7 +373,7 @@ class _ExecutorManagerThread(threading.Thread):
|
|||
assert not self.thread_wakeup._closed
|
||||
wakeup_reader = self.thread_wakeup._reader
|
||||
readers = [result_reader, wakeup_reader]
|
||||
worker_sentinels = [p.sentinel for p in self.processes.values()]
|
||||
worker_sentinels = [p.sentinel for p in list(self.processes.values())]
|
||||
ready = mp.connection.wait(readers + worker_sentinels)
|
||||
|
||||
cause = None
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Avoid a possible *"RuntimeError: dictionary changed size during iteration"*
|
||||
when adjusting the process count of :class:`ProcessPoolExecutor`.
|
Loading…
Add table
Add a link
Reference in a new issue