summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arrayobject.c1
-rw-r--r--numpy/core/src/scalartypes.inc.src12
2 files changed, 0 insertions, 13 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index f045dfc34..311b7117e 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -1432,7 +1432,6 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
}
else {
destptr = scalar_value(obj, descr);
- if (destptr == NULL) {Py_DECREF(obj); return NULL;}
}
/* copyswap for OBJECT increments the reference count */
copyswap(destptr, data, swap, base);
diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src
index fbdbbd9d4..956ce80fb 100644
--- a/numpy/core/src/scalartypes.inc.src
+++ b/numpy/core/src/scalartypes.inc.src
@@ -207,7 +207,6 @@ PyArray_CastScalarDirect(PyObject *scalar, PyArray_Descr *indescr,
castfunc = PyArray_GetCastFunc(indescr, outtype);
if (castfunc == NULL) return -1;
ptr = scalar_value(scalar, indescr);
- if (ptr == NULL) return -1;
castfunc(ptr, ctypeptr, 1, NULL, NULL);
return 0;
}
@@ -253,11 +252,6 @@ PyArray_FromScalar(PyObject *scalar, PyArray_Descr *outcode)
memptr = scalar_value(scalar, typecode);
- if (memptr == NULL) {
- Py_XDECREF(outcode);
- Py_DECREF(r);
- return NULL;
- }
#ifndef Py_UNICODE_WIDE
if (typecode->type_num == PyArray_UNICODE) {
@@ -883,7 +877,6 @@ gentype_real_get(PyObject *self)
void *ptr;
typecode = _realdescr_fromcomplexscalar(self, &typenum);
ptr = scalar_value(self, NULL);
- if (ptr == NULL) {Py_DECREF(typecode); return NULL;}
ret = PyArray_Scalar(ptr, typecode, NULL);
Py_DECREF(typecode);
return ret;
@@ -909,10 +902,6 @@ gentype_imag_get(PyObject *self)
char *ptr;
typecode = _realdescr_fromcomplexscalar(self, &typenum);
ptr = (char *)scalar_value(self, NULL);
- if (ptr == NULL) {
- Py_DECREF(typecode);
- return NULL;
- }
ret = PyArray_Scalar(ptr + typecode->elsize,
typecode, NULL);
}
@@ -1167,7 +1156,6 @@ voidtype_getfield(PyVoidScalarObject *self, PyObject *args, PyObject *kwds)
if (!PyArray_ISNBO(self->descr->byteorder)) {
new = PyArray_DescrFromScalar(ret);
ptr = scalar_value(ret, new);
- if (ptr == NULL) {Py_DECREF(new); return NULL;}
byte_swap_vector(ptr, 1, new->elsize);
Py_DECREF(new);
}