summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Andreas Entschev <peter@entschev.com>2020-11-17 10:03:11 -0800
committerPeter Andreas Entschev <peter@entschev.com>2020-11-17 10:03:11 -0800
commitfff2845fc1322980b519e3f36592a0d716fd945d (patch)
tree22daa9941538d7ed5cf5d0af4983a5be325388cd
parent7fe94363a9a567c89854d89f6f92ad8610f37c06 (diff)
downloadnumpy-fff2845fc1322980b519e3f36592a0d716fd945d.tar.gz
MAINT: Use get_array_function with like=
-rw-r--r--numpy/core/src/multiarray/arrayfunction_override.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/arrayfunction_override.c b/numpy/core/src/multiarray/arrayfunction_override.c
index 82f3a1c10..9254c6f6d 100644
--- a/numpy/core/src/multiarray/arrayfunction_override.c
+++ b/numpy/core/src/multiarray/arrayfunction_override.c
@@ -383,7 +383,7 @@ array_implement_c_array_function_creation(
if (like_arg == NULL) {
return NULL;
}
- else if (!PyObject_HasAttrString(like_arg, "__array_function__")) {
+ else if (!get_array_function(like_arg)) {
return PyErr_Format(
PyExc_TypeError,
"The `like` object must implement the `__array_function__` protocol");