summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-04-25 19:12:28 +0200
committerSebastian Berg <sebastianb@nvidia.com>2023-04-25 19:12:28 +0200
commit8b7f69ceae5cd99592f79121a1bd7b014af4833c (patch)
treee6f6ffea38cd70d2d3f1093d8d332ab7a283ef55
parentb4313643c052abb1c7966fbe42b2ae9c17259b59 (diff)
downloadnumpy-8b7f69ceae5cd99592f79121a1bd7b014af4833c.tar.gz
MAINT: Seems it should be -1 direction for matching a prefix
Not that it mattered, but docs say direction should be either -1 or 1
-rw-r--r--numpy/core/src/multiarray/arrayfunction_override.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/arrayfunction_override.c b/numpy/core/src/multiarray/arrayfunction_override.c
index 08d386e8b..3c55e2164 100644
--- a/numpy/core/src/multiarray/arrayfunction_override.c
+++ b/numpy/core/src/multiarray/arrayfunction_override.c
@@ -474,13 +474,13 @@ fix_name_if_typeerror(PyArray_ArrayFunctionDispatcherObject *self)
}
Py_ssize_t cmp = PyUnicode_Tailmatch(
- message, self->dispatcher_name, 0, -1, 0);
+ message, self->dispatcher_name, 0, -1, -1);
if (cmp <= 0) {
Py_DECREF(message);
goto restore_error;
}
Py_SETREF(message, PyUnicode_Replace(
- message, self->dispatcher_name, self->public_name, 1));
+ message, self->dispatcher_name, self->public_name, 1));
if (message == NULL) {
goto restore_error;
}