diff --git a/dvc/remote/ssh/connection.py b/dvc/remote/ssh/connection.py index c68334c2c..3c2a16e35 100644 --- a/dvc/remote/ssh/connection.py +++ b/dvc/remote/ssh/connection.py @@ -237,11 +237,15 @@ class SSHConnection: or channel.recv_ready() or channel.recv_stderr_ready() ): - import select + import selectors + + selector = selectors.DefaultSelector() + selector.register(stdout.channel, selectors.EVENT_READ) got_chunk = False - readq, _, _ = select.select([stdout.channel], [], [], self.timeout) - for c in readq: + events = selector.select(self.timeout) + for key, _ in events: + c = key.fileobj if c.recv_ready(): stdout_chunks.append(stdout.channel.recv(len(c.in_buffer))) got_chunk = True