summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarraymodule.c9
-rw-r--r--numpy/core/src/umathmodule.c.src7
2 files changed, 9 insertions, 7 deletions
diff --git a/numpy/core/src/multiarraymodule.c b/numpy/core/src/multiarraymodule.c
index 510adda9d..48b07d70d 100644
--- a/numpy/core/src/multiarraymodule.c
+++ b/numpy/core/src/multiarraymodule.c
@@ -5691,11 +5691,10 @@ DL_EXPORT(void) initmultiarray(void) {
if (_numpy_internal != NULL) return;
err:
- /* Check for errors */
- if (PyErr_Occurred())
- PyErr_Print();
- Py_FatalError("can't initialize module multiarray");
-
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot load multiarray module.");
+ }
return;
}
diff --git a/numpy/core/src/umathmodule.c.src b/numpy/core/src/umathmodule.c.src
index 1375efaa0..d2d0ca075 100644
--- a/numpy/core/src/umathmodule.c.src
+++ b/numpy/core/src/umathmodule.c.src
@@ -2056,6 +2056,9 @@ DL_EXPORT(void) initumath(void) {
err:
/* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module umath");
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "cannot load umath module.");
+ }
+ return;
}