diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-10-17 22:25:51 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-10-17 22:25:51 +0100 |
commit | d71f81b14e915aefcad293295d7db0139d58f0b2 (patch) | |
tree | a9cf89b0adf5734814b49ab69d3f30f06e697c2e /numpy | |
parent | 27c143c15da262fe2d233c0c310a184af21a8ff3 (diff) | |
download | numpy-d71f81b14e915aefcad293295d7db0139d58f0b2.tar.gz |
BUG: Don't narrow intp to int when producing error messages
Relates to the error message in gh-5975
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 5174bd889..9b6f59e3a 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -544,8 +544,8 @@ setArrayFromSequence(PyArrayObject *a, PyObject *s, */ if (slen != PyArray_DIMS(a)[dim] && slen != 1) { PyErr_Format(PyExc_ValueError, - "cannot copy sequence with size %d to array axis " - "with dimension %d", (int)slen, (int)PyArray_DIMS(a)[dim]); + "cannot copy sequence with size %zd to array axis " + "with dimension %" NPY_INTP_FMT, slen, PyArray_DIMS(a)[dim]); goto fail; } @@ -2894,8 +2894,8 @@ PyArray_CopyAsFlat(PyArrayObject *dst, PyArrayObject *src, NPY_ORDER order) src_size = PyArray_SIZE(src); if (dst_size != src_size) { PyErr_Format(PyExc_ValueError, - "cannot copy from array of size %d into an array " - "of size %d", (int)src_size, (int)dst_size); + "cannot copy from array of size %" NPY_INTP_FMT " into an array " + "of size %" NPY_INTP_FMT, src_size, dst_size); return -1; } |