summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/sftp_client.py5
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: