Skip to content

Commit

Permalink
Handle EAGAIN from socket.recv (closes #18)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Jul 9, 2012
1 parent f298316 commit 74724b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions acoustid/indexclient.py
Expand Up @@ -62,7 +62,7 @@ def _getline(self, timeout=None):
while pos == -1:
try:
ready_to_read, ready_to_write, in_error = select.select([self.sock], [], [self.sock], self.socket_timeout)
except OSError, e:
except select.error, e:
if e.errno == errno.EINTR:
continue
raise
Expand All @@ -72,9 +72,11 @@ def _getline(self, timeout=None):
while True:
try:
data = self.sock.recv(1024)
except OSError, e:
except socket.error, e:
if e.errno == errno.EINTR:
continue
if e.errno == errno.EAGAIN:
break
raise
if not data:
break
Expand Down

0 comments on commit 74724b4

Please sign in to comment.