[pypy-commit] pypy py3k: hg merge default

mjacob pypy.commits at gmail.com
Mon Oct 3 00:31:21 EDT 2016


Author: Manuel Jacob <me at manueljacob.de>
Branch: py3k
Changeset: r87537:6d29b5118ea6
Date: 2016-10-03 05:54 +0200
http://bitbucket.org/pypy/pypy/changeset/6d29b5118ea6/

Log:	hg merge default

diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -39,7 +39,7 @@
 from somewhere else.  You no longer have to do the same with the
 ``pypy`` executable, as long as it finds its ``libpypy-c.so`` library.
 
-.. branch: _warning
+.. branch: _warnings
 
 CPython allows warning.warn(('something', 1), Warning), on PyPy this
 produced a "expected a readable buffer object" error. Test and fix.
@@ -49,6 +49,11 @@
 CPython rejects 'a'.strip(buffer(' ')); only None, str or unicode are
 allowed as arguments. Test and fix for str and unicode
 
+.. branch: faulthandler
+
+Port the 'faulthandler' module to PyPy default.  This module is standard
+in Python 3.3 but can also be installed from CPython >= 2.6 from PyPI.
+
 .. branch: test-cpyext
 
 Refactor cpyext testing to be more pypy3-friendly.
diff --git a/pypy/module/cpyext/test/test_cpyext.py b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -392,6 +392,12 @@
 def debug_collect(space):
     rawrefcount._collect()
 
+def gc_collect3(space):
+    import gc
+    gc.collect()
+    gc.collect()
+    gc.collect()
+
 class AppTestCpythonExtensionBase(LeakCheckingTest):
 
     def setup_class(cls):
@@ -406,6 +412,8 @@
             #state = cls.space.fromcache(RefcountState) ZZZ
             #state.non_heaptypes_w[:] = []
             cls.w_debug_collect = space.wrap(interp2app(debug_collect))
+        else:
+            cls.debug_collect = gc_collect3
 
     def record_imported_module(self, name):
         """
diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py
--- a/pypy/tool/build_cffi_imports.py
+++ b/pypy/tool/build_cffi_imports.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
 import sys, shutil, os
 
 class MissingDependenciesError(Exception):
@@ -33,11 +34,11 @@
         else:
             args = ['-c', 'import ' + module]
             cwd = None
-        print >> sys.stderr, '*', ' '.join(args)
+        print('*', ' '.join(args), file=sys.stderr)
         try:
             status, stdout, stderr = run_subprocess(str(pypy_c), args, cwd=cwd)
             if status != 0:
-                print >> sys.stderr, stdout, stderr
+                print(stdout, stderr, file=sys.stderr)
                 failures.append((key, module))
         except:
             import traceback;traceback.print_exc()
@@ -46,7 +47,7 @@
 
 if __name__ == '__main__':
     if '__pypy__' not in sys.builtin_module_names:
-        print >> sys.stderr, 'Call with a pypy interpreter'
+        print('Call with a pypy interpreter', file=sys.stderr)
         sys.exit(1)
 
     tool_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
@@ -69,20 +70,20 @@
     options = Options()
     failures = create_cffi_import_libraries(exename, options, basedir)
     if len(failures) > 0:
-        print >> sys.stderr, '*** failed to build the CFFI modules %r' % (
-            [f[1] for f in failures],)
-        print >> sys.stderr, '''
+        print('*** failed to build the CFFI modules %r' % (
+            [f[1] for f in failures],), file=sys.stderr)
+        print('''
 PyPy can still be used as long as you don't need the corresponding
 modules.  If you do need them, please install the missing headers and
 libraries (see error messages just above) and then re-run the command:
 
     %s %s
-''' % (sys.executable, ' '.join(sys.argv))
+''' % (sys.executable, ' '.join(sys.argv)), file=sys.stderr)
         sys.exit(1)
 
     if len(sys.argv) > 1 and sys.argv[1] == '--test':
         # monkey patch a failure, just to test
-        print >> sys.stderr, 'This line should be followed by a traceback'
+        print('This line should be followed by a traceback', file=sys.stderr)
         for k in cffi_build_scripts:
             setattr(options, 'no_' + k, True)
         must_fail = '_missing_build_script.py'
diff --git a/rpython/jit/backend/llsupport/test/test_gc_integration.py b/rpython/jit/backend/llsupport/test/test_gc_integration.py
--- a/rpython/jit/backend/llsupport/test/test_gc_integration.py
+++ b/rpython/jit/backend/llsupport/test/test_gc_integration.py
@@ -323,13 +323,10 @@
     def test_malloc_slowpath(self):
         def check(frame):
             expected_size = 1
-            idx = 0
             fixed_size = self.cpu.JITFRAME_FIXED_SIZE
             if self.cpu.backend_name.startswith('arm'):
                 # jitframe fixed part is larger here
                 expected_size = 2
-                idx = 1
-                fixed_size -= 32
             if self.cpu.backend_name.startswith('zarch') or \
                self.cpu.backend_name.startswith('ppc'):
                 # the allocation always allocates the register
@@ -342,7 +339,10 @@
             # registers (p0 and p1 are moved away when doing p2, but not
             # spilled, just moved to different registers)
             bits = [n for n in range(fixed_size)
-                      if frame.jf_gcmap[idx] & (1<<n)]
+                      if frame.jf_gcmap[0] & (1<<n)]
+            if expected_size > 1:
+                bits += [n for n in range(32, fixed_size)
+                           if frame.jf_gcmap[1] & (1<<(n - 32))]
             assert len(bits) == 2
 
         self.cpu = self.getcpu(check)
diff --git a/rpython/translator/backendopt/test/test_mallocprediction.py b/rpython/translator/backendopt/test/test_mallocprediction.py
--- a/rpython/translator/backendopt/test/test_mallocprediction.py
+++ b/rpython/translator/backendopt/test/test_mallocprediction.py
@@ -169,7 +169,10 @@
     t, graph = rtype(entrypoint, [int])
     total0 = preparation(t, t.graphs, heuristic=heuristic)
     total = clever_inlining_and_malloc_removal(t)
-    assert total == 6     # XXX total0 appears to vary
+    assert total in (6, 7)     # XXX total0 appears to vary
+    # we get 6 before fbace1f687b0, but 7 afterwards on some
+    # platforms, probably because rtime.clock() now contains
+    # a fall-back path
 
 def test_richards():
     from rpython.translator.goal.richards import entry_point


More information about the pypy-commit mailing list