diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:04:27 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-30 00:04:27 +0100 |
commit | 2647375cc98ac47dffdf495fc4b0fe5973b0375d (patch) | |
tree | df9bf8676f542e148b28c8950a3ee2cab0f1cc0b /Lib/asyncio/windows_utils.py | |
parent | 29b40c1569e96182ba677f7d31bce45695913105 (diff) | |
parent | 978a9afc6af6c137065bdcf7ae4ef5450e5b2ec2 (diff) | |
download | cpython-git-2647375cc98ac47dffdf495fc4b0fe5973b0375d.tar.gz |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/asyncio/windows_utils.py')
-rw-r--r-- | Lib/asyncio/windows_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/windows_utils.py b/Lib/asyncio/windows_utils.py index 5f8327eba6..870cd13abe 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 |