mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
86ea58149c
commit
d0d64ad1f5
3 changed files with 30 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue