summaryrefslogtreecommitdiff
path: root/Lib/asyncio/unix_events.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-11-06 20:25:50 -0800
committerGuido van Rossum <guido@dropbox.com>2013-11-06 20:25:50 -0800
commit0b69fbc6420115ce11e7f18249280a2c6d9a87ce (patch)
treeb626b482fa7e8901b64d15fcf1cd4ec1817380fb /Lib/asyncio/unix_events.py
parent79ed4c744a0dc67941f539b3a7883dfe80ca24e8 (diff)
downloadcpython-git-0b69fbc6420115ce11e7f18249280a2c6d9a87ce.tar.gz
asyncio: Add close() back to Unix selector event loop, to remove all signal handlers. Should fix buildbot issues.
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r--Lib/asyncio/unix_events.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index dd57fe8e79..f4cf6e7f2a 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -48,6 +48,11 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
def _socketpair(self):
return socket.socketpair()
+ def close(self):
+ for sig in list(self._signal_handlers):
+ self.remove_signal_handler(sig)
+ super().close()
+
def add_signal_handler(self, sig, callback, *args):
"""Add a handler for a signal. UNIX only.