diff options
author | Guido van Rossum <guido@python.org> | 2014-01-10 21:30:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-01-10 21:30:04 (GMT) |
commit | 02757ea7e9bd3e3ea7c4cdb3f1c2b7f76fa2b294 (patch) | |
tree | d5fd40345e55caf999cdeac6aa6aa185afe04683 /Lib/asyncio/unix_events.py | |
parent | 4835f17c247cc9687c59f2faa6f69573f90d876e (diff) | |
download | cpython-02757ea7e9bd3e3ea7c4cdb3f1c2b7f76fa2b294.zip cpython-02757ea7e9bd3e3ea7c4cdb3f1c2b7f76fa2b294.tar.gz cpython-02757ea7e9bd3e3ea7c4cdb3f1c2b7f76fa2b294.tar.bz2 |
asyncio: Minimal pty support in UNIX read pipe, by Jonathan Slenders.
Diffstat (limited to 'Lib/asyncio/unix_events.py')
-rw-r--r-- | Lib/asyncio/unix_events.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index 80a98f8..24da327 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -190,7 +190,9 @@ class _UnixReadPipeTransport(transports.ReadTransport): self._pipe = pipe self._fileno = pipe.fileno() mode = os.fstat(self._fileno).st_mode - if not (stat.S_ISFIFO(mode) or stat.S_ISSOCK(mode)): + if not (stat.S_ISFIFO(mode) or + stat.S_ISSOCK(mode) or + stat.S_ISCHR(mode)): raise ValueError("Pipe transport is for pipes/sockets only.") _set_nonblocking(self._fileno) self._protocol = protocol @@ -228,7 +230,8 @@ class _UnixReadPipeTransport(transports.ReadTransport): def _fatal_error(self, exc): # should be called by exception handler only - logger.exception('Fatal error for %s', self) + if not (isinstance(exc, OSError) and exc.errno == errno.EIO): + logger.exception('Fatal error for %s', self) self._close(exc) def _close(self, exc): |