Commit 4a02543c authored by Andrew Svetlov's avatar Andrew Svetlov Committed by GitHub

bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown (#4956)

parent e47e698d
......@@ -51,8 +51,14 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
def close(self):
super().close()
for sig in list(self._signal_handlers):
self.remove_signal_handler(sig)
if not sys.is_finalizing():
for sig in list(self._signal_handlers):
self.remove_signal_handler(sig)
else:
warinigs.warn(f"Closing the loop {self!r} on interpreter shutdown "
f"stage, signal unsubsription is disabled",
ResourceWarning,
source=self)
def _process_self_data(self, data):
for signum in data:
......
Don't unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment