summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2007-09-23 23:25:34 -0700
committerRobey Pointer <robey@lag.net>2007-09-23 23:25:34 -0700
commit80b9e289cef4fc0939141ccf15751017a58a1637 (patch)
tree4724b4906c355a0e9dc917de7fb576dda202f2d8
parent2cf5448d430db8926d0af587b72d74a34fc5bd11 (diff)
[project @ robey@lag.net-20070924062534-5yemkpyjy2sssvjn]
bug 137219: handle EINTR in a read or write, if python doesn't.
-rw-r--r--paramiko/packet.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py
index 2cdf5d86..4bde2f75 100644
--- a/paramiko/packet.py
+++ b/paramiko/packet.py
@@ -218,6 +218,9 @@ class Packetizer (object):
# we need to work around it.
if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN):
got_timeout = True
+ elif (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EINTR):
+ # syscall interrupted; try again
+ pass
elif self.__closed:
raise EOFError()
else:
@@ -241,6 +244,9 @@ class Packetizer (object):
except socket.error, e:
if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN):
got_timeout = True
+ elif (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EINTR):
+ # syscall interrupted; try again
+ pass
else:
n = -1
except Exception: