Commit 22fc174e authored by Stefan Behnel's avatar Stefan Behnel

fused types: also ignore numpy import failures and not only failed lookups of...

fused types: also ignore numpy import failures and not only failed lookups of the ndarray type (both just let ndarrays be ignored further on)
parent 887c6d4a
...@@ -680,9 +680,10 @@ static PyObject* __Pyx__ImportNumPyArray(void) { ...@@ -680,9 +680,10 @@ static PyObject* __Pyx__ImportNumPyArray(void) {
numpy_module = __Pyx_Import(PYIDENT("numpy"), NULL, 0); numpy_module = __Pyx_Import(PYIDENT("numpy"), NULL, 0);
if (likely(numpy_module)) { if (likely(numpy_module)) {
ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray"); ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray");
if (unlikely(!ndarray_object)) { }
PyErr_Clear(); if (unlikely(!ndarray_object)) {
} // ImportError, AttributeError, ...
PyErr_Clear();
} }
if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) { if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) {
Py_XDECREF(ndarray_object); Py_XDECREF(ndarray_object);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment