[pypy-commit] pypy hpy: we no longer need the FakeSpec, we can call hpy_universal.load directly now

antocuni pypy.commits at gmail.com
Mon Nov 18 06:28:43 EST 2019


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: hpy
Changeset: r98106:2f6fc739e150
Date: 2019-11-18 11:13 +0100
http://bitbucket.org/pypy/pypy/changeset/2f6fc739e150/

Log:	we no longer need the FakeSpec, we can call hpy_universal.load
	directly now

diff --git a/pypy/module/hpy_universal/test/support.py b/pypy/module/hpy_universal/test/support.py
--- a/pypy/module/hpy_universal/test/support.py
+++ b/pypy/module/hpy_universal/test/support.py
@@ -25,14 +25,6 @@
             pytest.skip()
         cls.compiler = ExtensionCompiler(udir)
 
-        w_FakeSpec = cls.space.appexec([], """():
-            class FakeSpec:
-                def __init__(self, name, origin):
-                    self.name = name
-                    self.origin = origin
-            return FakeSpec
-        """)
-
         @unwrap_spec(source_template='text', name='text')
         def descr_make_module(space, source_template, name='mytest'):
             source = _support.expand_template(source_template, name)
@@ -46,11 +38,10 @@
             so_filename = _support.c_compile(str(tmpdir), ext, compiler_verbose=False,
                                     universal_mode=True)
             #
-            w_mod = space.appexec(
-                [w_FakeSpec, space.newtext(so_filename), space.newtext(name)],
-                """(FakeSpec, path, modname):
-                    from hpy_universal import load_from_spec
-                    return load_from_spec(FakeSpec(modname, path))
+            w_mod = space.appexec([space.newtext(so_filename), space.newtext(name)],
+                """(path, modname):
+                    import hpy_universal
+                    return hpy_universal.load(modname, path)
                 """
             )
             return w_mod


More information about the pypy-commit mailing list