Author: Antonio Cuni <[email protected]>
Branch: hpy
Changeset: r98091:a4e8d4a49fff
Date: 2019-11-17 01:02 +0100
http://bitbucket.org/pypy/pypy/changeset/a4e8d4a49fff/

Log:    use the new handles context manager here

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
@@ -31,10 +31,9 @@
 
     def call_noargs(self, space):
         state = space.fromcache(State)
-        h_self = handles.new(space, self.w_self)
-        h_result = generic_cpy_call_dont_convert_result(space, self.cfuncptr,
-            state.ctx, h_self, 0)
-        handles.consume(space, h_self)
+        with handles.using(space, self.w_self) as h_self:
+            h_result = generic_cpy_call_dont_convert_result(space, 
self.cfuncptr,
+                state.ctx, h_self, 0)
         # XXX check for exceptions
         return handles.consume(space, h_result)
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to