summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/umath/test_rational.c.src6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/umath/test_rational.c.src b/numpy/core/src/umath/test_rational.c.src
index 7545ebca4..aca3d21f3 100644
--- a/numpy/core/src/umath/test_rational.c.src
+++ b/numpy/core/src/umath/test_rational.c.src
@@ -1312,5 +1312,11 @@ fail:
PyErr_SetString(PyExc_RuntimeError,
"cannot load test_rational module.");
}
+#if defined(NPY_PY3K)
+ if (m) {
+ Py_DECREF(m);
+ m = NULL;
+ }
+#endif
return RETVAL;
}