summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <antoine@python.org>2015-04-23 16:58:44 +0200
committerAntoine Pitrou <antoine@python.org>2015-04-23 16:58:44 +0200
commite440e674e5d332f99a42bd488c6900829f6d55a2 (patch)
treea9c739ff9321f4f49dacdf376a82021d426c9fb6
parentb635ba42007a69c8fa4dabb1e6668e26447e0fb3 (diff)
downloadnumpy-e440e674e5d332f99a42bd488c6900829f6d55a2.tar.gz
BUG: reference stolen from None when looking up a ufunc's identity attribute
A new reference must be returned by the C getter function, not a borrowed one.
-rw-r--r--numpy/core/src/umath/ufunc_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 36201b3ea..9f89d71c2 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -5547,7 +5547,7 @@ ufunc_get_identity(PyUFuncObject *ufunc)
case PyUFunc_Zero:
return PyInt_FromLong(0);
}
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *