summaryrefslogtreecommitdiff
path: root/numpy/core/src/multiarray/ctors.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:32:58 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:32:58 +0900
commitdafde1312a74de106e0e114de78b9ae5f52f0b78 (patch)
tree07b322b6dfbfa69110f399218d35d53c167fcaf7 /numpy/core/src/multiarray/ctors.c
parent546f3e50ef3710ae2fc394774c63eefc7801ca0f (diff)
downloadpython-numpy-dafde1312a74de106e0e114de78b9ae5f52f0b78.tar.gz
python-numpy-dafde1312a74de106e0e114de78b9ae5f52f0b78.tar.bz2
python-numpy-dafde1312a74de106e0e114de78b9ae5f52f0b78.zip
Imported Upstream version 1.15.1upstream/1.15.1
Diffstat (limited to 'numpy/core/src/multiarray/ctors.c')
-rw-r--r--numpy/core/src/multiarray/ctors.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index 7367902cc..28a414892 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -92,6 +92,7 @@ swab_separator(const char *sep)
s = start = malloc(strlen(sep)+3);
if (s == NULL) {
+ PyErr_NoMemory();
return NULL;
}
/* add space to front if there isn't one */
@@ -1389,10 +1390,12 @@ _array_from_buffer_3118(PyObject *memoryview)
if (!is_ctypes) {
/* This object has no excuse for a broken PEP3118 buffer */
- PyErr_SetString(
+ PyErr_Format(
PyExc_RuntimeError,
- "Item size computed from the PEP 3118 buffer format "
- "string does not match the actual item size.");
+ "Item size %zd for PEP 3118 buffer format "
+ "string %s does not match the dtype %c item size %d.",
+ view->itemsize, view->format, descr->type,
+ descr->elsize);
Py_DECREF(descr);
return NULL;
}