summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/transport.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/transport.py b/paramiko/transport.py
index 6aae0837..990c9d3c 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -1608,7 +1608,10 @@ class Transport (threading.Thread):
self.saved_exception = e
except socket.error, e:
if type(e.args) is tuple:
- emsg = '%s (%d)' % (e.args[1], e.args[0])
+ if e.args:
+ emsg = '%s (%d)' % (e.args[1], e.args[0])
+ else: # empty tuple, e.g. socket.timeout
+ emsg = str(e) or repr(e)
else:
emsg = e.args
self._log(ERROR, 'Socket exception: ' + emsg)