Author: Alexander Hesse <webmas...@aquanasoft.de> Branch: split-rpython Changeset: r59945:6e461b5f80d0 Date: 2013-01-11 08:32 +0100 http://bitbucket.org/pypy/pypy/changeset/6e461b5f80d0/
Log: Fixed a few more socket things diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py --- a/pypy/module/_socket/interp_socket.py +++ b/pypy/module/_socket/interp_socket.py @@ -3,6 +3,7 @@ interp_attrproperty from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from rpython.rlib.rarithmetic import intmask +from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib import rsocket from rpython.rlib.rsocket import RSocket, AF_INET, SOCK_STREAM from rpython.rlib.rsocket import SocketError, SocketErrorWithErrno, RSocketError @@ -129,6 +130,7 @@ # XXX Hack to seperate rpython and pypy def ipaddr_from_object(space, w_sockaddr): + from rpython.rlib.rsocket import makeipaddr host = space.str_w(space.getitem(w_sockaddr, space.wrap(0))) addr = makeipaddr(host) addr_fill_from_object(addr, space, w_sockaddr) 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 @@ -242,6 +242,7 @@ assert space.str_w(space.getitem(w_obj, space.wrap(1))) == 'c' def test_addr_raw_packet(): + from pypy.module._socket.interp_socket import addr_as_object if not hasattr(rsocket._c, 'sockaddr_ll'): py.test.skip("posix specific test") # HACK: To get the correct interface numer of lo, which in most cases is 1, @@ -266,7 +267,7 @@ # fd needs to be somehow valid s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) fd = s.fileno() - w_obj = rsocket.make_address(c_addr, addrlen).as_object(fd, space) + w_obj = addr_as_object(rsocket.make_address(c_addr, addrlen), (fd, space)) lltype.free(c_addr_ll, flavor='raw') assert space.is_true(space.eq(w_obj, space.newtuple([ space.wrap('lo'), _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit