-
-
Save simlun/5178295 to your computer and use it in GitHub Desktop.
socket recv's may raise EAGAIN, unlike any other platform
Fix for recognizing gdbm 1.9.x databases; already upstream:
http://hg.python.org/cpython/rev/14cafb8d1480
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Lib/socket.py b/Lib/socket.py | |
index bd364e7..fd432f6 100644 | |
--- a/Lib/socket.py | |
+++ b/Lib/socket.py | |
@@ -92,6 +92,7 @@ except ImportError: | |
errno = None | |
EBADF = getattr(errno, 'EBADF', 9) | |
EINTR = getattr(errno, 'EINTR', 4) | |
+EAGAIN = getattr(errno, 'EAGAIN', 35) | |
__all__ = ["getfqdn", "create_connection"] | |
__all__.extend(os._get_exports_list(_socket)) | |
@@ -446,7 +447,7 @@ class _fileobject(object): | |
try: | |
data = self._sock.recv(self._rbufsize) | |
except error, e: | |
- if e.args[0] == EINTR: | |
+ if e.args[0] in (EINTR, EAGAIN): | |
continue | |
raise | |
if not data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment