diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 22:57:27 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-14 22:57:27 +0100 |
commit | 3835c52709c0f5c0bb567f648c86455e00c4c7b7 (patch) | |
tree | e85a4a6c9a3a93e4c18a4a3ef24174be028f0e5a /asyncio | |
parent | 849b259271b489e1d37205b65642722b40c2331e (diff) | |
download | trollius-3835c52709c0f5c0bb567f648c86455e00c4c7b7.tar.gz |
PipeHandle now uses None instead of -1 for a closed handle
Sort also imports in windows_utils.
Diffstat (limited to 'asyncio')
-rw-r--r-- | asyncio/windows_utils.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/asyncio/windows_utils.py b/asyncio/windows_utils.py index b475812..e664296 100644 --- a/asyncio/windows_utils.py +++ b/asyncio/windows_utils.py @@ -7,13 +7,13 @@ import sys if sys.platform != 'win32': # pragma: no cover raise ImportError('win32 only') -import socket +import _winapi import itertools import msvcrt import os +import socket import subprocess import tempfile -import _winapi __all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle'] @@ -136,7 +136,7 @@ class PipeHandle: self._handle = handle def __repr__(self): - if self._handle != -1: + if self._handle is not None: handle = 'handle=%r' % self._handle else: handle = 'closed' @@ -150,9 +150,9 @@ class PipeHandle: return self._handle def close(self, *, CloseHandle=_winapi.CloseHandle): - if self._handle != -1: + if self._handle is not None: CloseHandle(self._handle) - self._handle = -1 + self._handle = None __del__ = close |