diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2017-12-24 11:50:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-24 11:50:03 (GMT) |
commit | 4f146f9ed133b9ad56d4ee7a653396836af34067 (patch) | |
tree | 627dcf36f9da7cf6d7b5b859cf640a62f0557d34 | |
parent | 4856b0f34a6f4074cd86e66f11a635422374ae98 (diff) | |
download | cpython-4f146f9ed133b9ad56d4ee7a653396836af34067.zip cpython-4f146f9ed133b9ad56d4ee7a653396836af34067.tar.gz cpython-4f146f9ed133b9ad56d4ee7a653396836af34067.tar.bz2 |
bpo-26133: Clear signals list on interpreter finalizing (#5002)
-rw-r--r-- | Lib/asyncio/unix_events.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index ec767f5..5d6a3c0 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -55,10 +55,13 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): 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) + if self._signal_handlers: + warinigs.warn(f"Closing the loop {self!r} " + f"on interpreter shutdown " + f"stage, signal unsubsription is disabled", + ResourceWarning, + source=self) + self._signal_handlers.clear() def _process_self_data(self, data): for signum in data: |