summaryrefslogtreecommitdiffstats
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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py
index 5f8327e..870cd13 100644
--- a/Lib/asyncio/windows_utils.py
+++ b/Lib/asyncio/windows_utils.py
@@ -14,6 +14,7 @@ import os
import socket
import subprocess
import tempfile
+import warnings
__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
@@ -156,7 +157,10 @@ class PipeHandle:
CloseHandle(self._handle)
self._handle = None
- __del__ = close
+ def __del__(self):
+ if self._handle is not None:
+ warnings.warn("unclosed %r" % self, ResourceWarning)
+ self.close()
def __enter__(self):
return self