[pypy-commit] pypy hpy: (antocuni, arigo): implement HPyNone_Get, test_noop_function finally passes
antocuni
pypy.commits at gmail.com
Sat Nov 16 18:22:25 EST 2019
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: hpy
Changeset: r98082:bacbce0ca621
Date: 2019-11-16 23:44 +0100
http://bitbucket.org/pypy/pypy/changeset/bacbce0ca621/
Log: (antocuni, arigo): implement HPyNone_Get, test_noop_function finally
passes
diff --git a/pypy/module/hpy_universal/interp_extfunc.py b/pypy/module/hpy_universal/interp_extfunc.py
--- a/pypy/module/hpy_universal/interp_extfunc.py
+++ b/pypy/module/hpy_universal/interp_extfunc.py
@@ -33,7 +33,7 @@
h_result = generic_cpy_call_dont_convert_result(space, self.cfuncptr,
state.ctx, 0, 0)
# XXX check for exceptions
- return handles.consume(h_result)
+ return handles.consume(space, h_result)
def call_o(self, space, w_arg):
raise NotImplementedError("later")
diff --git a/pypy/module/hpy_universal/interp_hpy.py b/pypy/module/hpy_universal/interp_hpy.py
--- a/pypy/module/hpy_universal/interp_hpy.py
+++ b/pypy/module/hpy_universal/interp_hpy.py
@@ -29,6 +29,11 @@
return handles.new(space, w_mod)
+ at slot_function([llapi.HPyContext], llapi.HPy, error=0)
+def HPyNone_Get(space, ctx):
+ return handles.new(space, space.w_None)
+
+
def create_hpy_module(space, name, origin, lib, initfunc):
state = space.fromcache(State)
initfunc = rffi.cast(llapi.HPyInitFuncPtr, initfunc)
diff --git a/pypy/module/hpy_universal/state.py b/pypy/module/hpy_universal/state.py
--- a/pypy/module/hpy_universal/state.py
+++ b/pypy/module/hpy_universal/state.py
@@ -31,3 +31,6 @@
space = self.space
funcptr = interp_hpy.HPyModule_Create.api_func.get_llhelper(space)
self.ctx.ctx_Module_Create = rffi.cast(rffi.VOIDP, funcptr)
+ #
+ funcptr = interp_hpy.HPyNone_Get.api_func.get_llhelper(space)
+ self.ctx.ctx_None_Get = rffi.cast(rffi.VOIDP, funcptr)
More information about the pypy-commit
mailing list