From b0d2f785049a4f97a0411b06baa3ac028fa40a0c Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 16 Nov 2023 13:30:39 +0300 Subject: [PATCH] + last argument for UNARY_FUNC() --- Objects/abstract.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index decbf626b3d094..56cdfd696e5e35 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1344,7 +1344,7 @@ _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs) /* Unary operators and functions */ -#define UNARY_FUNC(func, op, meth_name) \ +#define UNARY_FUNC(func, op, meth_name, descr) \ PyObject * \ func(PyObject *o) { \ if (o == NULL) { \ @@ -1358,13 +1358,13 @@ _PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs) return res; \ } \ \ - return type_error("bad operand type for unary -: '%.200s'", o); \ + return type_error("bad operand type for "descr": '%.200s'", o); \ } -UNARY_FUNC(PyNumber_Negative, nb_negative, __neg__) -UNARY_FUNC(PyNumber_Positive, nb_positive, __pow__) -UNARY_FUNC(PyNumber_Invert, nb_invert, __invert__) -UNARY_FUNC(PyNumber_Absolute, nb_absolute, __abs__) +UNARY_FUNC(PyNumber_Negative, nb_negative, __neg__, "unary -") +UNARY_FUNC(PyNumber_Positive, nb_positive, __pow__, "unary +") +UNARY_FUNC(PyNumber_Invert, nb_invert, __invert__, "unary ~") +UNARY_FUNC(PyNumber_Absolute, nb_absolute, __abs__, "abs()") int