Skip to content

Commit f6d7427

Browse files
hauntsaninjahauntsaninja
authored and
hauntsaninja
committed
[3.9] bpo-39349: Add cancel_futures to Executor.shutdown base class (pythonGH-22023)
* Add cancel_futures parameter to the Executor base class, since it was missed in the original PR (python#18057) that added cancel_futures. (cherry picked from commit 17dc1b7) Co-authored-by: Shantanu <[email protected]>
1 parent d14775d commit f6d7427

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/concurrent/futures/_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def result_iterator():
605605
future.cancel()
606606
return result_iterator()
607607

608-
def shutdown(self, wait=True):
608+
def shutdown(self, wait=True, *, cancel_futures=False):
609609
"""Clean-up the resources associated with the Executor.
610610
611611
It is safe to call this method several times. Otherwise, no other
@@ -615,6 +615,9 @@ def shutdown(self, wait=True):
615615
wait: If True then shutdown will not return until all running
616616
futures have finished executing and the resources used by the
617617
executor have been reclaimed.
618+
cancel_futures: If True then shutdown will cancel all pending
619+
futures. Futures that are completed or running will not be
620+
cancelled.
618621
"""
619622
pass
620623

0 commit comments

Comments
 (0)