summaryrefslogtreecommitdiff
path: root/Lib/asyncio/windows_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/windows_utils.py')
-rw-r--r--Lib/asyncio/windows_utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py
index 9e22f6e074..ef277fac3e 100644
--- a/Lib/asyncio/windows_utils.py
+++ b/Lib/asyncio/windows_utils.py
@@ -107,10 +107,9 @@ class PipeHandle:
CloseHandle(self._handle)
self._handle = None
- def __del__(self):
+ def __del__(self, _warn=warnings.warn):
if self._handle is not None:
- warnings.warn(f"unclosed {self!r}", ResourceWarning,
- source=self)
+ _warn(f"unclosed {self!r}", ResourceWarning, source=self)
self.close()
def __enter__(self):