From fe2dab59c50244041f0309ff75913d11066759a6 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Sun, 30 Aug 2020 23:05:24 -0700 Subject: [PATCH 1/2] bpo-39349: Add cancel_futures to Executor.shutdown --- Lib/concurrent/futures/_base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index bf546f8ae1d1cc..00eb54881f2958 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -605,7 +605,7 @@ def result_iterator(): future.cancel() return result_iterator() - def shutdown(self, wait=True): + def shutdown(self, wait=True, *, cancel_futures=False): """Clean-up the resources associated with the Executor. It is safe to call this method several times. Otherwise, no other @@ -615,6 +615,9 @@ def shutdown(self, wait=True): wait: If True then shutdown will not return until all running futures have finished executing and the resources used by the executor have been reclaimed. + cancel_futures: If True then shutdown will cancel all pending + futures. Futures that are completed or running will not be + cancelled. """ pass From 94d8ce06bd5d4a6a7779f2c67389b6758ee46427 Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Tue, 1 Sep 2020 13:44:05 -0700 Subject: [PATCH 2/2] empty commit