| 3245 | } |
| 3246 | |
| 3247 | static PyObject * |
| 3248 | array__reconstruct(PyObject *NPY_UNUSED(dummy), PyObject *args) |
| 3249 | { |
| 3250 | |
| 3251 | PyObject *ret; |
| 3252 | PyTypeObject *subtype; |
| 3253 | PyArray_Dims shape = {NULL, 0}; |
| 3254 | PyArray_Descr *dtype = NULL; |
| 3255 | |
| 3256 | evil_global_disable_warn_O4O8_flag = 1; |
| 3257 | |
| 3258 | if (!PyArg_ParseTuple(args, "O!O&O&:_reconstruct", |
| 3259 | &PyType_Type, &subtype, |
| 3260 | PyArray_IntpConverter, &shape, |
| 3261 | PyArray_DescrConverter, &dtype)) { |
| 3262 | goto fail; |
| 3263 | } |
| 3264 | if (!PyType_IsSubtype(subtype, &PyArray_Type)) { |
| 3265 | PyErr_SetString(PyExc_TypeError, |
| 3266 | "_reconstruct: First argument must be a sub-type of ndarray"); |
| 3267 | goto fail; |
| 3268 | } |
| 3269 | ret = PyArray_NewFromDescr(subtype, dtype, |
| 3270 | (int)shape.len, shape.ptr, NULL, NULL, 0, NULL); |
| 3271 | npy_free_cache_dim_obj(shape); |
| 3272 | |
| 3273 | evil_global_disable_warn_O4O8_flag = 0; |
| 3274 | |
| 3275 | return ret; |
| 3276 | |
| 3277 | fail: |
| 3278 | evil_global_disable_warn_O4O8_flag = 0; |
| 3279 | |
| 3280 | Py_XDECREF(dtype); |
| 3281 | npy_free_cache_dim_obj(shape); |
| 3282 | return NULL; |
| 3283 | } |
| 3284 | |
| 3285 | static PyObject * |
| 3286 | array_set_string_function(PyObject *NPY_UNUSED(self), PyObject *args, |
nothing calls this directly
no test coverage detected