From a2fa8ecbf28ba643323b82ad5efa1e25c1ecfc3d Mon Sep 17 00:00:00 2001 From: rudolf-blue Date: Fri, 9 Oct 2026 07:33:13 -0400 Subject: [PATCH] Use Py_RETURN_NOTIMPLEMENTED in color rich comparisons --- kitty/colors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/colors.c b/kitty/colors.c index a28f90e00..65bf1c188 100644 --- a/kitty/colors.c +++ b/kitty/colors.c @@ -1080,7 +1080,7 @@ sharp_get(Color *self, void *closure UNUSED) { static PyObject * color_cmp(PyObject *self, PyObject *other, int op) { - if (op != Py_EQ && op != Py_NE) return Py_NotImplemented; + if (op != Py_EQ && op != Py_NE) Py_RETURN_NOTIMPLEMENTED; if (!PyObject_TypeCheck(other, &Color_Type)) { if (op == Py_EQ) Py_RETURN_FALSE; Py_RETURN_TRUE; @@ -1095,7 +1095,7 @@ color_cmp(PyObject *self, PyObject *other, int op) { if (a->color.val != b->color.val) { Py_RETURN_TRUE; } Py_RETURN_FALSE; } - default: return Py_NotImplemented; + default: Py_RETURN_NOTIMPLEMENTED; } }