Author: mattip <matti.pi...@gmail.com>
Branch: numpy-unify-methods
Changeset: r61226:207f00864f45
Date: 2013-02-14 00:30 +0200
http://bitbucket.org/pypy/pypy/changeset/207f00864f45/

Log:    fix exception formatting

diff --git a/pypy/module/micronumpy/interp_ufuncs.py 
b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -260,7 +260,7 @@
                       space.wrap('Not implemented for this type'))
         if self.int_only and not w_obj.get_dtype().is_int_type():
             raise OperationError(space.w_TypeError, space.wrap(
-                "ufunc %s not supported for the input type", self.name))
+                "ufunc %s not supported for the input type" % self.name))
         calc_dtype = find_unaryop_result_dtype(space,
                                   w_obj.get_dtype(),
                                   promote_to_float=self.promote_to_float,
@@ -342,7 +342,7 @@
             )
         if self.int_only and not calc_dtype.is_int_type():
             raise OperationError(space.w_TypeError, space.wrap(
-                "ufunc '%s' not supported for the input types", self.name))
+                "ufunc '%s' not supported for the input types" % self.name))
         if space.is_none(w_out):
             out = None
         elif not isinstance(w_out, W_NDimArray):
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py 
b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -109,7 +109,8 @@
         assert len(missing) == 2 and set(missing) == set(['bitwise_not', 
'invert']) 
         a = np.array(1.0,'complex')
         missing = missing_ufuncs(a) 
-        assert len(missing) == 14 and set(missing) == \
+        assert len(missing) == 14
+        assert set(missing) == \
             set(['bitwise_not', 'ceil', 'deg2rad', 'degrees', 'fabs', 'floor',
                 'rad2deg', 'invert', 'spacing', 'radians',  'frexp', 'signbit',
                 'modf', 'trunc'])
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to