bug 137219: handle EINTR in a read or write, if python doesn't.
This commit is contained in:
Robey Pointer 2007-09-23 23:25:34 -07:00
parent 2cf5448d43
commit 80b9e289ce
1 changed files with 6 additions and 0 deletions

View File

@ -218,6 +218,9 @@ class Packetizer (object):
# we need to work around it. # we need to work around it.
if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN): if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN):
got_timeout = True 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: elif self.__closed:
raise EOFError() raise EOFError()
else: else:
@ -241,6 +244,9 @@ class Packetizer (object):
except socket.error, e: except socket.error, e:
if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN): if (type(e.args) is tuple) and (len(e.args) > 0) and (e.args[0] == errno.EAGAIN):
got_timeout = True 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: else:
n = -1 n = -1
except Exception: except Exception: