Author: Armin Rigo <[email protected]>
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'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit