Commits

Alex Gaynor committed 25fd786 Merge

merged default in

Comments (0)

Files changed (15)

pypy/interpreter/test/test_executioncontext.py

         import os, sys
         print sys.executable, self.tmpfile
         if sys.platform == "win32":
-            cmdformat = '""%s" "%s""'    # excellent! tons of "!
+            cmdformat = '"%s" "%s"'
         else:
             cmdformat = "'%s' '%s'"
         g = os.popen(cmdformat % (sys.executable, self.tmpfile), 'r')

pypy/module/_rawffi/test/test__rawffi.py

         assert ret.y == 1234500, "ret.y == %d" % (ret.y,)
         s.free()
 
+    def test_ffi_type(self):
+        import _rawffi
+        EMPTY = _rawffi.Structure([])
+        S2E = _rawffi.Structure([('bah', (EMPTY, 1))])
+        S2E.get_ffi_type()     # does not hang
+
 class AppTestAutoFree:
     def setup_class(cls):
         space = gettestobjspace(usemodules=('_rawffi', 'struct'))

pypy/module/test_lib_pypy/test_pwd.py

+import py, sys
 from pypy.conftest import gettestobjspace
 
 class AppTestPwd:
     def setup_class(cls):
+        if sys.platform == 'win32':
+            py.test.skip("Unix only")
         cls.space = gettestobjspace(usemodules=('_ffi', '_rawffi'))
         cls.space.appexec((), "(): import pwd")
 

pypy/objspace/std/intobject.py

 """
 
 class W_AbstractIntObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_IntObject(W_AbstractIntObject):
     __slots__ = 'intval'

pypy/objspace/std/iterobject.py

 
 
 class W_AbstractIterObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_AbstractSeqIterObject(W_AbstractIterObject):
     from pypy.objspace.std.itertype import iter_typedef as typedef

pypy/objspace/std/listobject.py

 from pypy.interpreter.argument import Signature
 
 class W_AbstractListObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_ListObject(W_AbstractListObject):
     from pypy.objspace.std.listtype import list_typedef as typedef

pypy/objspace/std/longobject.py

 from pypy.rlib.rbigint import rbigint, SHIFT
 
 class W_AbstractLongObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_LongObject(W_AbstractLongObject):
     """This is a wrapper of rbigint."""

pypy/objspace/std/stringobject.py

 from pypy.objspace.std.formatting import mod_format
 
 class W_AbstractStringObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_StringObject(W_AbstractStringObject):
     from pypy.objspace.std.stringtype import str_typedef as typedef

pypy/objspace/std/test/test_sliceobject.py

+import sys
 from pypy.objspace.std.sliceobject import normalize_simple_slice
 
 
                         sl = space.newslice(w(start), w(stop), w(step))
                         mystart, mystop, mystep, slicelength = sl.indices4(space, length)
                         assert len(range(length)[start:stop:step]) == slicelength
-                        assert slice(start, stop, step).indices(length) == (
-                                mystart, mystop, mystep)
+                        if sys.version_info >= (2, 6):   # doesn't work in 2.5
+                            assert slice(start, stop, step).indices(length) == (
+                                    mystart, mystop, mystep)
 
 class AppTest_SliceObject:
     def test_new(self):

pypy/objspace/std/tupleobject.py

 from pypy.rlib.debug import make_sure_not_resized
 
 class W_AbstractTupleObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_TupleObject(W_AbstractTupleObject):
     from pypy.objspace.std.tupletype import tuple_typedef as typedef

pypy/objspace/std/unicodeobject.py

 from pypy.objspace.std.stringtype import stringstartswith, stringendswith
 
 class W_AbstractUnicodeObject(W_Object):
-    pass
+    __slots__ = ()
 
 class W_UnicodeObject(W_AbstractUnicodeObject):
     from pypy.objspace.std.unicodetype import unicode_typedef as typedef

pypy/translator/platform/__init__.py

 
     so_prefixes = ('',)
 
+    extra_libs = ()
+
     def __init__(self, cc):
         if self.__class__ is Platform:
             raise TypeError("You should not instantiate Platform class directly")
         link_files = self._linkfiles(eci.link_files)
         export_flags = self._exportsymbols_link_flags(eci)
         return (library_dirs + list(self.link_flags) + export_flags +
-                link_files + list(eci.link_extra) + libraries)
+                link_files + list(eci.link_extra) + libraries +
+                list(self.extra_libs))
 
     def _exportsymbols_link_flags(self, eci, relto=None):
         if eci.export_symbols:

pypy/translator/platform/linux.py

 class BaseLinux(BasePosix):
     name = "linux"
     
-    link_flags = ('-pthread', '-lrt')
+    link_flags = ('-pthread',)
+    extra_libs = ('-lrt',)
     cflags = ('-O3', '-pthread', '-fomit-frame-pointer',
               '-Wall', '-Wno-unused')
     standalone_only = ()

pypy/translator/platform/posix.py

             ('DEFAULT_TARGET', exe_name.basename),
             ('SOURCES', rel_cfiles),
             ('OBJECTS', rel_ofiles),
-            ('LIBS', self._libs(eci.libraries)),
+            ('LIBS', self._libs(eci.libraries) + list(self.extra_libs)),
             ('LIBDIRS', self._libdirs(rel_libdirs)),
             ('INCLUDEDIRS', self._includedirs(rel_includedirs)),
             ('CFLAGS', cflags),

pypy/translator/platform/test/test_posix.py

         if self.strict_on_stderr:
             assert res.err == ''
         assert res.returncode == 0
+        assert '-lrt' in tmpdir.join("Makefile").read()
 
     def test_link_files(self):
         tmpdir = udir.join('link_files' + self.__class__.__name__).ensure(dir=1)