Browse files

Handle EAGAIN from socket.recv (closes #18)

  • Loading branch information...
1 parent f298316 commit 74724b4198d61cdc2e7a7d001157d269c00b6520 @lalinsky lalinsky committed Jul 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 acoustid/indexclient.py
View
6 acoustid/indexclient.py
@@ -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
@@ -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

0 comments on commit 74724b4

Please sign in to comment.