diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 17:29:06 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 17:29:06 +0100 |
commit | 132011f2502ea17d1921185852a7bd23bb14be16 (patch) | |
tree | 58b799eb266a589ef05d9a682e0228a901f14f0a /asyncio | |
parent | 79ed2e7e02718cb086b74a13e107c86e81cdc37d (diff) | |
download | trollius-132011f2502ea17d1921185852a7bd23bb14be16.tar.gz |
Add repr(PipeHandle)
Diffstat (limited to 'asyncio')
-rw-r--r-- | asyncio/windows_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/asyncio/windows_utils.py b/asyncio/windows_utils.py index 1155a77..c6e4bc9 100644 --- a/asyncio/windows_utils.py +++ b/asyncio/windows_utils.py @@ -134,6 +134,13 @@ class PipeHandle: def __init__(self, handle): self._handle = handle + def __repr__(self): + if self._handle != -1: + handle = 'handle=%r' % self._handle + else: + handle = 'closed' + return '<%s %s>' % (self.__class__.__name__, handle) + @property def handle(self): return self._handle |