mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown (GH-4956) (#4962)
(cherry picked from commit 4a02543cf9
)
This commit is contained in:
parent
fdb148f949
commit
3bc68cff5b
2 changed files with 9 additions and 2 deletions
|
@ -61,8 +61,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