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

bpo-26133: Clear signals list on interpreter finalizing (#5002)

parent 4856b0f3
...@@ -55,10 +55,13 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): ...@@ -55,10 +55,13 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
for sig in list(self._signal_handlers): for sig in list(self._signal_handlers):
self.remove_signal_handler(sig) self.remove_signal_handler(sig)
else: else:
warinigs.warn(f"Closing the loop {self!r} on interpreter shutdown " if self._signal_handlers:
warinigs.warn(f"Closing the loop {self!r} "
f"on interpreter shutdown "
f"stage, signal unsubsription is disabled", f"stage, signal unsubsription is disabled",
ResourceWarning, ResourceWarning,
source=self) source=self)
self._signal_handlers.clear()
def _process_self_data(self, data): def _process_self_data(self, data):
for signum in data: for signum in data:
......
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