mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown (#4956)
This commit is contained in:
parent
e47e698da6
commit
4a02543cf9
2 changed files with 9 additions and 2 deletions
|
|
@ -51,8 +51,14 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
super().close()
|
super().close()
|
||||||
for sig in list(self._signal_handlers):
|
if not sys.is_finalizing():
|
||||||
self.remove_signal_handler(sig)
|
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):
|
def _process_self_data(self, data):
|
||||||
for signum in data:
|
for signum in data:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Don't unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue