[pypy-commit] pypy default: Kill a dependency to the stdobjspace.

arigo noreply at buildbot.pypy.org
Wed Dec 7 17:40:13 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r50268:93c1adc1f2e5
Date: 2011-12-07 17:07 +0100
http://bitbucket.org/pypy/pypy/changeset/93c1adc1f2e5/

Log:	Kill a dependency to the stdobjspace.

diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -4,7 +4,6 @@
 from pypy.interpreter.typedef import TypeDef
 from pypy.objspace.std.floattype import float_typedef
 from pypy.objspace.std.inttype import int_typedef
-from pypy.objspace.std.typeobject import W_TypeObject
 from pypy.rlib.rarithmetic import LONG_BIT
 from pypy.tool.sourcetools import func_with_new_name
 
@@ -33,9 +32,8 @@
     _attrs_ = ()
 
     def descr__new__(space, w_subtype, __args__):
-        assert isinstance(w_subtype, W_TypeObject)
         raise operationerrfmt(space.w_TypeError, "cannot create '%s' instances",
-            w_subtype.get_module_type_name()
+            w_subtype.getname(space, '?')
         )
 
     def descr_str(self, space):
@@ -266,4 +264,4 @@
     __module__ = "numpypy",
 
     __new__ = interp2app(W_Float64Box.descr__new__.im_func),
-)
\ No newline at end of file
+)
diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -173,7 +173,7 @@
         raises(TypeError, numpy.number, 0)
         raises(TypeError, numpy.integer, 0)
         exc = raises(TypeError, numpy.signedinteger, 0)
-        assert str(exc.value) == "cannot create 'numpypy.signedinteger' instances"
+        assert str(exc.value) == "cannot create 'signedinteger' instances"
 
         raises(TypeError, numpy.floating, 0)
         raises(TypeError, numpy.inexact, 0)


More information about the pypy-commit mailing list