[pypy-commit] pypy dtypes-compatability: fix z_translation, test_compile (arigato)
mattip
noreply at buildbot.pypy.org
Fri Jun 12 10:48:09 CEST 2015
Author: mattip <matti.picus at gmail.com>
Branch: dtypes-compatability
Changeset: r78039:781c31ed6f8d
Date: 2015-06-12 11:48 +0300
http://bitbucket.org/pypy/pypy/changeset/781c31ed6f8d/
Log: fix z_translation, test_compile (arigato)
diff --git a/pypy/module/micronumpy/compile.py b/pypy/module/micronumpy/compile.py
--- a/pypy/module/micronumpy/compile.py
+++ b/pypy/module/micronumpy/compile.py
@@ -47,6 +47,9 @@
def lookup(self, name):
return self.getdictvalue(self, name)
+ def getname(self, space):
+ return self.name
+
class FakeSpace(ObjSpace):
w_ValueError = W_TypeObject("ValueError")
w_TypeError = W_TypeObject("TypeError")
diff --git a/pypy/module/micronumpy/descriptor.py b/pypy/module/micronumpy/descriptor.py
--- a/pypy/module/micronumpy/descriptor.py
+++ b/pypy/module/micronumpy/descriptor.py
@@ -176,12 +176,7 @@
return dtype
def get_name(self):
- from pypy.objspace.std.typeobject import W_TypeObject
- w_box_type = self.w_box_type
- assert isinstance(w_box_type, W_TypeObject)
- name = w_box_type.getname(self.itemtype.space)
- if name.startswith('numpy.'):
- name = name[6:]
+ name = self.w_box_type.getname(self.itemtype.space)
if name.endswith('_'):
name = name[:-1]
return name
diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py
--- a/pypy/objspace/fake/objspace.py
+++ b/pypy/objspace/fake/objspace.py
@@ -72,6 +72,10 @@
def get_module(self):
return w_some_obj()
+
+ def getname(self, space):
+ return self.name
+
def w_some_obj():
if NonConstant(False):
return W_Root()
More information about the pypy-commit
mailing list