[pypy-commit] pypy py3.6: A large speedup to the own test 'test_recompiler' in py3.6

arigo pypy.commits at gmail.com
Thu Sep 12 05:59:05 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6
Changeset: r97457:2d88bbee870d
Date: 2019-09-12 11:57 +0200
http://bitbucket.org/pypy/pypy/changeset/2d88bbee870d/

Log:	A large speedup to the own test 'test_recompiler' in py3.6

diff --git a/pypy/module/_cffi_backend/test/test_recompiler.py b/pypy/module/_cffi_backend/test/test_recompiler.py
--- a/pypy/module/_cffi_backend/test/test_recompiler.py
+++ b/pypy/module/_cffi_backend/test/test_recompiler.py
@@ -75,8 +75,12 @@
 
     args_w = [space.wrap(module_name), space.wrap(so_file)]
     w_res = space.appexec(args_w, """(modulename, filename):
-        import imp
-        mod = imp.load_dynamic(modulename, filename)
+        import _imp
+        class Spec: pass
+        spec = Spec()
+        spec.name = modulename
+        spec.origin = filename
+        mod = _imp.create_dynamic(spec)
         assert mod.__name__ == modulename
         return (mod.ffi, mod.lib)
     """)


More information about the pypy-commit mailing list