Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.5 Changeset: r94284:c84d22857147 Date: 2018-04-09 11:31 +0300 http://bitbucket.org/pypy/pypy/changeset/c84d22857147/
Log: test, fix for issue 2787 (now passes on -A --python=python3) 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 @@ -33,7 +33,7 @@ space.newint(addr.get_protocol()), space.newint(addr.get_pkttype()), space.newint(addr.get_hatype()), - space.newtext(addr.get_haddr())]) + space.newbytes(addr.get_haddr())]) elif rsocket.HAS_AF_UNIX and isinstance(addr, rsocket.UNIXAddress): path = addr.get_path() if _c.linux and len(path) > 0 and path[0] == '\x00': 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 @@ -768,13 +768,14 @@ def test_convert_between_tuple_and_sockaddr_ll(self): import _socket s = _socket.socket(_socket.AF_PACKET, _socket.SOCK_RAW) - assert s.getsockname() == ('', 0, 0, 0, '') + assert s.getsockname() == ('', 0, 0, 0, b''), 's.getsockname %s' % str(s.getsockname()) s.bind(('lo', 123)) a, b, c, d, e = s.getsockname() assert (a, b, c) == ('lo', 123, 0) assert isinstance(d, int) - assert isinstance(e, str) + assert isinstance(e, bytes) assert 0 <= len(e) <= 8 + s.close() class AppTestSocketTCP: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit