aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/concurrent/futures
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/concurrent/futures')
-rw-r--r--Lib/concurrent/futures/interpreter.py2
-rw-r--r--Lib/concurrent/futures/process.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/Lib/concurrent/futures/interpreter.py b/Lib/concurrent/futures/interpreter.py
index a2c4fbfd3fb..f12b4ac33cd 100644
--- a/Lib/concurrent/futures/interpreter.py
+++ b/Lib/concurrent/futures/interpreter.py
@@ -167,7 +167,7 @@ class WorkerContext(_thread.WorkerContext):
except _interpqueues.QueueError:
continue
except ModuleNotFoundError:
- # interpreters.queues doesn't exist, which means
+ # interpreters._queues doesn't exist, which means
# QueueEmpty doesn't. Act as though it does.
continue
else:
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
index 76b7b2abe83..a14650bf5fa 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -755,6 +755,11 @@ class ProcessPoolExecutor(_base.Executor):
self._executor_manager_thread_wakeup
def _adjust_process_count(self):
+ # gh-132969: avoid error when state is reset and executor is still running,
+ # which will happen when shutdown(wait=False) is called.
+ if self._processes is None:
+ return
+
# if there's an idle process, we don't need to spawn a new one.
if self._idle_worker_semaphore.acquire(blocking=False):
return