Author: Armin Rigo <[email protected]>
Branch:
Changeset: r44186:12020cd2f5b4
Date: 2011-05-15 18:49 +0200
http://bitbucket.org/pypy/pypy/changeset/12020cd2f5b4/
Log: merge heads
diff --git a/pypy/module/_socket/test/test_sock_app.py
b/pypy/module/_socket/test/test_sock_app.py
--- a/pypy/module/_socket/test/test_sock_app.py
+++ b/pypy/module/_socket/test/test_sock_app.py
@@ -372,11 +372,12 @@
def test_socket_connect(self):
import _socket, os
s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0)
- # XXX temporarily we use codespeak to test, will have more robust
tests in
- # the absence of a network connection later when more parts of the
socket
- # API are implemented. currently skip the test if there is no
connection.
+ # XXX temporarily we use python.org to test, will have more robust
tests
+ # in the absence of a network connection later when more parts of the
+ # socket API are implemented. Currently skip the test if there is no
+ # connection.
try:
- s.connect(("codespeak.net", 80))
+ s.connect(("www.python.org", 80))
except _socket.gaierror, ex:
skip("GAIError - probably no connection: %s" % str(ex.args))
name = s.getpeername() # Will raise socket.error if not connected
@@ -506,11 +507,12 @@
# Test that send/sendall/sendto accept a buffer or a unicode as arg
import _socket, os
s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM, 0)
- # XXX temporarily we use codespeak to test, will have more robust
tests in
- # the absence of a network connection later when more parts of the
socket
- # API are implemented. currently skip the test if there is no
connection.
+ # XXX temporarily we use python.org to test, will have more robust
tests
+ # in the absence of a network connection later when more parts of the
+ # socket API are implemented. Currently skip the test if there is no
+ # connection.
try:
- s.connect(("codespeak.net", 80))
+ s.connect(("www.python.org", 80))
except _socket.gaierror, ex:
skip("GAIError - probably no connection: %s" % str(ex.args))
s.send(buffer(''))
diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -899,7 +899,7 @@
def _ssl_thread_id_function():
from pypy.module.thread import ll_thread
- return ll_thread.get_ident()
+ return rffi.cast(rffi.INT, ll_thread.get_ident())
def setup_ssl_threads():
from pypy.module.thread import ll_thread
diff --git a/pypy/module/_ssl/test/test_ssl.py
b/pypy/module/_ssl/test/test_ssl.py
--- a/pypy/module/_ssl/test/test_ssl.py
+++ b/pypy/module/_ssl/test/test_ssl.py
@@ -81,7 +81,7 @@
ss = _ssl.sslwrap(s, 0)
s.close()
exc = raises(_ssl.SSLError, ss.write, "data")
- assert exc.value.message == "Underlying socket has been closed."
+ assert exc.value.strerror == "Underlying socket has been closed."
class AppTestConnectedSSL:
@@ -90,8 +90,8 @@
cls.space = space
def setup_method(self, method):
- # https://codespeak.net/
- ADDR = "codespeak.net", 443
+ # https://www.verisign.net/
+ ADDR = "www.verisign.net", 443
self.w_s = self.space.appexec([self.space.wrap(ADDR)], """(ADDR):
import socket
diff --git a/pypy/module/thread/ll_thread.py b/pypy/module/thread/ll_thread.py
--- a/pypy/module/thread/ll_thread.py
+++ b/pypy/module/thread/ll_thread.py
@@ -114,6 +114,8 @@
c_thread_releaselock(self._lock)
def __del__(self):
+ if free_ll_lock is None: # happens when tests are shutting down
+ return
free_ll_lock(self._lock)
def __enter__(self):
diff --git a/pypy/rlib/test/test_rsocket.py b/pypy/rlib/test/test_rsocket.py
--- a/pypy/rlib/test/test_rsocket.py
+++ b/pypy/rlib/test/test_rsocket.py
@@ -297,24 +297,25 @@
e = py.test.raises(GAIError, getaddrinfo, 'www.very-invalidaddress.com',
None)
assert isinstance(e.value.get_msg(), str)
-def test_getaddrinfo_codespeak():
- lst = getaddrinfo('codespeak.net', None)
+def test_getaddrinfo_pydotorg():
+ lst = getaddrinfo('python.org', None)
assert isinstance(lst, list)
found = False
for family, socktype, protocol, canonname, addr in lst:
- if addr.get_host() == '88.198.193.90':
+ if addr.get_host() == '82.94.164.162':
found = True
assert found, lst
def test_getaddrinfo_no_reverse_lookup():
# It seems that getaddrinfo never runs a reverse lookup on Linux.
# Python2.3 on Windows returns the hostname.
- lst = getaddrinfo('213.239.226.252', None, flags=AI_NUMERICHOST)
+ lst = getaddrinfo('82.94.164.162', None, flags=AI_NUMERICHOST)
assert isinstance(lst, list)
found = False
+ print lst
for family, socktype, protocol, canonname, addr in lst:
- assert canonname != 'codespeak.net'
- if addr.get_host() == '213.239.226.252':
+ assert 'python.org' not in canonname
+ if addr.get_host() == '82.94.164.162':
found = True
assert found, lst
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit