[pypy-commit] pypy cpyext-injection: translation fix

arigo pypy.commits at gmail.com
Thu Oct 20 12:02:33 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: cpyext-injection
Changeset: r87898:55fc9655deb0
Date: 2016-10-20 17:33 +0200
http://bitbucket.org/pypy/pypy/changeset/55fc9655deb0/

Log:	translation fix

diff --git a/pypy/module/cpyext/injection/numpy.py b/pypy/module/cpyext/injection/numpy.py
--- a/pypy/module/cpyext/injection/numpy.py
+++ b/pypy/module/cpyext/injection/numpy.py
@@ -23,7 +23,9 @@
 
 class Original:
     def __init__(self, space):
-        pass
+        self.injected_methods_w = []
+        for key, value in injected_methods.items():
+            self.injected_methods_w.append((key, space.wrap(value)))
 
 class W_ArrayObject(W_Root):
     pass
@@ -63,8 +65,8 @@
     assert name == 'numpy.ndarray'
     org = space.fromcache(Original)
     org.w_original_getitem = dict_w['__getitem__']
-    for key, value in injected_methods.items():
-        dict_w[key] = space.wrap(value)
+    for key, w_value in org.injected_methods_w:
+        dict_w[key] = w_value
 
 def inject_module(space, w_mod, name):
     assert name == 'numpy.core.multiarray'


More information about the pypy-commit mailing list