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

This commit is contained in:
Andrew Svetlov 2017-12-24 13:50:03 +02:00 committed by GitHub
parent 4856b0f34a
commit 4f146f9ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -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: