diff options
author | Bernát Gábor <bgabor8@bloomberg.net> | 2020-10-26 09:16:37 +0000 |
---|---|---|
committer | Bernát Gábor <bgabor8@bloomberg.net> | 2020-10-26 09:28:50 +0000 |
commit | d1b667210817d0706c93da4d3cd01f51a0334443 (patch) | |
tree | cbcc6b7da9b56ad6d86a7789b4bb86b13d913bba /src/tox/execute | |
parent | 9ef0d811a3ce9e85ba86cec142f2c346c1d420c7 (diff) | |
download | tox-git-d1b667210817d0706c93da4d3cd01f51a0334443.tar.gz |
Add typing to test suite
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Diffstat (limited to 'src/tox/execute')
-rw-r--r-- | src/tox/execute/local_sub_process/read_via_thread_unix.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tox/execute/local_sub_process/read_via_thread_unix.py b/src/tox/execute/local_sub_process/read_via_thread_unix.py index a5b1b69b..b16b0c66 100644 --- a/src/tox/execute/local_sub_process/read_via_thread_unix.py +++ b/src/tox/execute/local_sub_process/read_via_thread_unix.py @@ -27,7 +27,10 @@ class ReadViaThreadUnix(ReadViaThread): def _drain_stream(self) -> bytes: result = bytearray() # on closed file read returns empty while True: - last_result = os.read(self.file_no, 1) + try: + last_result = os.read(self.file_no, 1) + except OSError: # ignore failing to read the pipe - already closed + break if last_result: result.append(last_result[0]) else: |