diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 1299390..74f810a 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -54,6 +54,7 @@ import multiprocessing from multiprocessing import SimpleQueue from multiprocessing.connection import wait import threading +import signal import weakref # Workers are created as daemon threads and processes. This is done to allow the @@ -122,11 +123,13 @@ def _process_worker(call_queue, result_queue): worker that it should exit when call_queue is empty. """ while True: + s = signal.signal(signal.SIGINT, signal.SIG_IGN) call_item = call_queue.get(block=True) if call_item is None: # Wake up queue management thread result_queue.put(os.getpid()) return + signal.signal(signal.SIGINT, s) try: r = call_item.fn(*call_item.args, **call_item.kwargs) except BaseException as e: