Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r51706:454ec575a42a
Date: 2012-01-24 02:40 +0200
http://bitbucket.org/pypy/pypy/changeset/454ec575a42a/
Log: merge
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
@@ -67,9 +67,6 @@
self.connect(self.addr_from_object(space, w_addr))
except SocketError, e:
raise converted_error(space, e)
- except TypeError, e:
- raise OperationError(space.w_TypeError,
- space.wrap(str(e)))
def connect_ex_w(self, space, w_addr):
"""connect_ex(address) -> errno
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
@@ -64,8 +64,8 @@
def test_sslwrap(self):
import _ssl, _socket, sys, gc
- if sys.platform == 'darwin':
- skip("hangs indefinitely on OSX (also on CPython)")
+ if sys.platform == 'darwin' or 'freebsd' in sys.platform:
+ skip("hangs indefinitely on OSX & FreeBSD (also on CPython)")
s = _socket.socket()
ss = _ssl.sslwrap(s, 0)
exc = raises(_socket.error, ss.do_handshake)
diff --git a/pypy/module/fcntl/test/test_fcntl.py
b/pypy/module/fcntl/test/test_fcntl.py
--- a/pypy/module/fcntl/test/test_fcntl.py
+++ b/pypy/module/fcntl/test/test_fcntl.py
@@ -42,13 +42,9 @@
else:
start_len = "qq"
- if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3',
- 'Darwin1.2', 'darwin',
- 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
- 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9',
- 'bsdos2', 'bsdos3', 'bsdos4',
- 'openbsd', 'openbsd2', 'openbsd3', 'openbsd4',
- 'openbsd5'):
+ if any(substring in sys.platform.lower()
+ for substring in ('netbsd', 'darwin', 'freebsd', 'bsdos',
+ 'openbsd')):
if struct.calcsize('l') == 8:
off_t = 'l'
pid_t = 'i'
@@ -182,7 +178,8 @@
def test_large_flag(self):
import sys
- if sys.platform == "darwin" or sys.platform.startswith("openbsd"):
+ if any(plat in sys.platform
+ for plat in ('darwin', 'openbsd', 'freebsd')):
skip("Mac OS doesn't have any large flag in fcntl.h")
import fcntl, sys
if sys.maxint == 2147483647:
diff --git a/pypy/module/posix/test/test_posix2.py
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -371,6 +371,8 @@
if hasattr(__import__(os.name), "forkpty"):
def test_forkpty(self):
import sys
+ if 'freebsd' in sys.platform:
+ skip("hangs indifinitly on FreeBSD (also on CPython).")
os = self.posix
childpid, master_fd = os.forkpty()
assert isinstance(childpid, int)
diff --git a/pypy/rlib/rdynload.py b/pypy/rlib/rdynload.py
--- a/pypy/rlib/rdynload.py
+++ b/pypy/rlib/rdynload.py
@@ -14,7 +14,7 @@
_MINGW = platform.name == "mingw32"
_WIN32 = _MSVC or _MINGW
_MAC_OS = platform.name == "darwin"
-_FREEBSD = platform.name == "freebsd"
+_FREEBSD = sys.platform.startswith("freebsd")
if _WIN32:
from pypy.rlib import rwin32
diff --git a/pypy/rlib/rsocket.py b/pypy/rlib/rsocket.py
--- a/pypy/rlib/rsocket.py
+++ b/pypy/rlib/rsocket.py
@@ -310,10 +310,7 @@
def from_object(space, w_address):
# Parse an app-level object representing an AF_INET address
- try:
- w_host, w_port = space.unpackiterable(w_address, 2)
- except ValueError:
- raise TypeError("AF_INET address must be a tuple of length 2")
+ w_host, w_port = space.unpackiterable(w_address, 2)
host = space.str_w(w_host)
port = space.int_w(w_port)
port = Address.make_ushort_port(space, port)
@@ -544,10 +541,7 @@
space.wrap(self.get_groups())])
def from_object(space, w_address):
- try:
- w_pid, w_groups = space.unpackiterable(w_address, 2)
- except ValueError:
- raise TypeError("AF_NETLINK address must be a tuple of length
2")
+ w_pid, w_groups = space.unpackiterable(w_address, 2)
return NETLINKAddress(space.uint_w(w_pid), space.uint_w(w_groups))
from_object = staticmethod(from_object)
diff --git a/pypy/rpython/lltypesystem/ll2ctypes.py
b/pypy/rpython/lltypesystem/ll2ctypes.py
--- a/pypy/rpython/lltypesystem/ll2ctypes.py
+++ b/pypy/rpython/lltypesystem/ll2ctypes.py
@@ -1390,7 +1390,8 @@
def _where_is_errno():
return standard_c_lib.__errno_location()
- elif sys.platform in ('darwin', 'freebsd7', 'freebsd8', 'freebsd9'):
+ elif any(plat in sys.platform
+ for plat in ('darwin', 'freebsd7', 'freebsd8', 'freebsd9')):
standard_c_lib.__error.restype = ctypes.POINTER(ctypes.c_int)
def _where_is_errno():
return standard_c_lib.__error()
diff --git a/pypy/rpython/memory/gc/env.py b/pypy/rpython/memory/gc/env.py
--- a/pypy/rpython/memory/gc/env.py
+++ b/pypy/rpython/memory/gc/env.py
@@ -116,7 +116,7 @@
def get_total_memory():
return get_total_memory_darwin(get_darwin_sysctl_signed('hw.memsize'))
-elif sys.platform.startswith('freebsd'):
+elif 'freebsd' in sys.platform:
def get_total_memory():
return get_total_memory_darwin(get_darwin_sysctl_signed('hw.usermem'))
diff --git a/pypy/rpython/module/ll_time.py b/pypy/rpython/module/ll_time.py
--- a/pypy/rpython/module/ll_time.py
+++ b/pypy/rpython/module/ll_time.py
@@ -41,7 +41,7 @@
RUSAGE = platform.Struct('struct rusage', [('ru_utime', TIMEVAL),
('ru_stime', TIMEVAL)])
-if "freebsd" in sys.platform:
+if sys.platform.startswith('freebsd'):
libraries = ['compat']
else:
libraries = []
diff --git a/pypy/translator/platform/freebsd.py
b/pypy/translator/platform/freebsd.py
--- a/pypy/translator/platform/freebsd.py
+++ b/pypy/translator/platform/freebsd.py
@@ -18,8 +18,9 @@
class Freebsd(posix.BasePosix):
name = "freebsd"
- link_flags = get_env_vector("LDFLAGS", '-pthread')
- cflags = get_env_vector("CFLAGS", "-O3 -pthread -fomit-frame-pointer")
+ link_flags = ['-pthread'] + get_env_vector('LDFLAGS', '')
+ cflags = ['-O3', '-pthread', '-fomit-frame-pointer'
+ ] + get_env_vector('CFLAGS', '')
standalone_only = []
shared_only = []
so_ext = 'so'
diff --git a/pypy/translator/platform/linux.py
b/pypy/translator/platform/linux.py
--- a/pypy/translator/platform/linux.py
+++ b/pypy/translator/platform/linux.py
@@ -1,15 +1,20 @@
"""Support for Linux."""
+import os
import sys
from pypy.translator.platform.posix import BasePosix
class BaseLinux(BasePosix):
name = "linux"
- link_flags = ('-pthread',)
+ link_flags = tuple(
+ ['-pthread',]
+ + os.environ.get('LDFLAGS', '').split())
extra_libs = ('-lrt',)
- cflags = ('-O3', '-pthread', '-fomit-frame-pointer',
- '-Wall', '-Wno-unused')
+ cflags = tuple(
+ ['-O3', '-pthread', '-fomit-frame-pointer',
+ '-Wall', '-Wno-unused']
+ + os.environ.get('CFLAGS', '').split())
standalone_only = ()
shared_only = ('-fPIC',)
so_ext = 'so'
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit