diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 17:32:39 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-29 17:32:39 +0100 |
| commit | 190e78603a4ce58a2f248fdf8a3472fa1fc6c064 (patch) | |
| tree | 0990f66b83b12d6466ba5042bfbb0b02442ab5e7 /asyncio/windows_utils.py | |
| parent | a1611f147decd003b0ffe5d10eb011d0b8c2725e (diff) | |
| download | trollius-master.tar.gz | |
event loop or a transport is not explicitly closed
Diffstat (limited to 'asyncio/windows_utils.py')
| -rw-r--r-- | asyncio/windows_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/asyncio/windows_utils.py b/asyncio/windows_utils.py index 5f8327e..870cd13 100644 --- a/asyncio/windows_utils.py +++ b/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 |
