mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
bpo-26133: Clear signals list on interpreter finalizing (GH-5002) (#5003)
(cherry picked from commit 4f146f9ed1
)
This commit is contained in:
parent
6ba0637727
commit
5ff5d1167d
1 changed files with 7 additions and 4 deletions
|
@ -65,10 +65,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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue