diff options
Diffstat (limited to 'termcast_client/pity.py')
-rw-r--r-- | termcast_client/pity.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/termcast_client/pity.py b/termcast_client/pity.py index 26a9e49..966c793 100644 --- a/termcast_client/pity.py +++ b/termcast_client/pity.py @@ -1,3 +1,4 @@ +import errno import fcntl import os import pty @@ -5,6 +6,8 @@ import signal import termios import tty +from . import py2compat + CHILD = pty.CHILD STDIN_FILENO = pty.STDIN_FILENO STDOUT_FILENO = pty.STDOUT_FILENO @@ -68,9 +71,9 @@ def spawn(argv, master_read=pty._read, stdin_read=pty._read, handle_window_size= while True: try: pty._copy(master_fd, master_read, stdin_read) - except InterruptedError: - continue - except OSError: + except OSError as e: + if e.errno == errno.EINTR: + continue if restore: tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode) break |