[pypy-svn] r46817 - pypy/dist/pypy/rlib

arigo at codespeak.net arigo at codespeak.net
Sat Sep 22 13:58:18 CEST 2007


Author: arigo
Date: Sat Sep 22 13:58:18 2007
New Revision: 46817

Modified:
   pypy/dist/pypy/rlib/rsocket.py
Log:
Minor fix.


Modified: pypy/dist/pypy/rlib/rsocket.py
==============================================================================
--- pypy/dist/pypy/rlib/rsocket.py	(original)
+++ pypy/dist/pypy/rlib/rsocket.py	Sat Sep 22 13:58:18 2007
@@ -545,7 +545,7 @@
         def _select(self, for_writing):
             """Returns 0 when reading/writing is possible,
             1 when timing out and -1 on error."""
-            if self.timeout <= 0.0 or self.fd < 0:
+            if self.timeout <= 0.0 or self.fd == _c.INVALID_SOCKET:
                 # blocking I/O or no socket.
                 return 0
             pollfd = rffi.make(_c.pollfd)
@@ -569,7 +569,7 @@
         def _select(self, for_writing):
             """Returns 0 when reading/writing is possible,
             1 when timing out and -1 on error."""
-            if self.timeout <= 0.0 or self.fd < 0:
+            if self.timeout <= 0.0 or self.fd == _c.INVALID_SOCKET:
                 # blocking I/O or no socket.
                 return 0
             tv = rffi.make(_c.timeval)



More information about the Pypy-commit mailing list