Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r70876:bda7970f05c4
Date: 2014-04-22 15:40 -0700
http://bitbucket.org/pypy/pypy/changeset/bda7970f05c4/

Log:    more test_rsocket fixes

diff --git a/rpython/rlib/_rsocket_rffi.py b/rpython/rlib/_rsocket_rffi.py
--- a/rpython/rlib/_rsocket_rffi.py
+++ b/rpython/rlib/_rsocket_rffi.py
@@ -629,6 +629,10 @@
     WSAGetLastError = external('WSAGetLastError', [], rffi.INT)
     geterrno = WSAGetLastError
 
+    # In tests, the first call to GetLastError is always wrong, because error
+    # is hidden by operations in ll2ctypes.  Call it now.
+    WSAGetLastError()
+
     from rpython.rlib import rwin32
 
     def socket_strerror_str(errno):
diff --git a/rpython/rlib/test/test_rsocket.py 
b/rpython/rlib/test/test_rsocket.py
--- a/rpython/rlib/test/test_rsocket.py
+++ b/rpython/rlib/test/test_rsocket.py
@@ -340,8 +340,12 @@
 def test_connect_with_timeout_fail():
     s = RSocket()
     s.settimeout(0.1)
+    if sys.platform == 'win32':
+        addr = '169.254.169.254'
+    else:
+        addr = '240.240.240.240'
     with py.test.raises(SocketTimeout):
-        s.connect(INETAddress('10.10.10.10', 12345))
+        s.connect(INETAddress(addr, 12345))
     s.close()
 
 def test_connect_with_timeout_succeed():
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to