diff options
author | Robey Pointer <robey@lag.net> | 2006-09-11 10:56:04 -0700 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2006-09-11 10:56:04 -0700 |
commit | 31c26eafb90f245ea0d2baf60a5a573b362d901e (patch) | |
tree | c2b8492dcb938db7acd3a22c9abf75fb3efbefc2 | |
parent | 4acb9589ced5a05d9f52f7fcb0f3f8630cb37c71 (diff) |
[project @ robey@lag.net-20060911175604-bf2798fcebd62780]
trap EOF errors when reading a response, and translate into SSHException
-rw-r--r-- | paramiko/sftp_client.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py index 6fa1cd93..9a1ecfdc 100644 --- a/paramiko/sftp_client.py +++ b/paramiko/sftp_client.py @@ -598,7 +598,10 @@ class SFTPClient (BaseSFTP): def _read_response(self, waitfor=None): while True: - t, data = self._read_packet() + try: + t, data = self._read_packet() + except EOFError, e: + raise SSHException('Server connection dropped: %s' % (str(e),)) msg = Message(data) num = msg.get_int() if num not in self._expecting: |