summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-12-24 12:30:57 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2017-12-24 12:30:57 (GMT)
commit5ff5d1167de88eb37265dcaf1396d12617a0ace7 (patch)
tree65ec2d851d58ebd3ee2170438f0f68950bfc483e /Lib
parent6ba06377276fca9dc703c5139e2f0ea0ff03636a (diff)
downloadcpython-5ff5d1167de88eb37265dcaf1396d12617a0ace7.zip
cpython-5ff5d1167de88eb37265dcaf1396d12617a0ace7.tar.gz
cpython-5ff5d1167de88eb37265dcaf1396d12617a0ace7.tar.bz2
bpo-26133: Clear signals list on interpreter finalizing (GH-5002) (#5003)
(cherry picked from commit 4f146f9ed133b9ad56d4ee7a653396836af34067)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/unix_events.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index dde1d35..70b7050 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -65,10 +65,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: