summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorPierre Glaser <pierreglaser@msn.com>2019-05-10 18:42:35 (GMT)
committerAntoine Pitrou <antoine@python.org>2019-05-10 18:42:35 (GMT)
commitd0d64ad1f5f1dc1630004091d7f8209546c1220a (patch)
tree930a44cdff935895a33f121da0f3fb63fcfdc100 /Lib/multiprocessing
parent86ea58149c3e83f402cecd17e6a536865fb06ce1 (diff)
downloadcpython-d0d64ad1f5f1dc1630004091d7f8209546c1220a.zip
cpython-d0d64ad1f5f1dc1630004091d7f8209546c1220a.tar.gz
cpython-d0d64ad1f5f1dc1630004091d7f8209546c1220a.tar.bz2
bpo-36368: Ignore SIGINT in SharedMemoryManager servers. (GH-12483)
Fix a bug crashing SharedMemoryManager instances in interactive sessions after a Ctrl-C (KeyboardInterrupt) was sent.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/managers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py
index 22abd47..2bad636 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -17,6 +17,7 @@ __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
import sys
import threading
+import signal
import array
import queue
import time
@@ -596,6 +597,9 @@ class BaseManager(object):
'''
Create a server, report its address and run it
'''
+ # bpo-36368: protect server process from KeyboardInterrupt signals
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+
if initializer is not None:
initializer(*initargs)