Commits

Brian Kearns committed b945ca0

make this error message match numpy

Comments (0)

Files changed (2)

pypy/module/micronumpy/interp_arrayops.py

                 shape[i] += axis_size
         a_dt = arr.get_dtype()
         if dtype.is_record_type() and a_dt.is_record_type():
-            #Record types must match
+            # Record types must match
             for f in dtype.fields:
                 if f not in a_dt.fields or \
                              dtype.fields[f] != a_dt.fields[f]:
                     raise OperationError(space.w_TypeError,
-                               space.wrap("record type mismatch"))
+                               space.wrap("invalid type promotion"))
         elif dtype.is_record_type() or a_dt.is_record_type():
             raise OperationError(space.w_TypeError,
                         space.wrap("invalid type promotion"))

pypy/module/micronumpy/test/test_numarray.py

         exc = raises(TypeError, concatenate,
                             (zeros((2,), dtype=[('x', int), ('y', float)]),
                             (zeros((2,), dtype=[('x', float), ('y', float)]))))
-        assert str(exc.value).startswith('record type mismatch')
+        assert str(exc.value).startswith('invalid type promotion')
         exc = raises(TypeError, concatenate, ([1], zeros((2,),
                                             dtype=[('x', int), ('y', float)])))
         assert str(exc.value).startswith('invalid type promotion')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.