From 8b7f69ceae5cd99592f79121a1bd7b014af4833c Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 25 Apr 2023 19:12:28 +0200 Subject: 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 --- numpy/core/src/multiarray/arrayfunction_override.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy') 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; } -- cgit v1.2.1