bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown (#4956)
This commit is contained in:
parent
e47e698da6
commit
4a02543cf9
|
@ -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:
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Don't unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
|
Loading…
Reference in New Issue