From 3ed063a80e6cbc66740b05da084164d22dcdfc9a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 22 Jun 2026 08:10:21 +1000 Subject: [PATCH] If error is raised, return NULL --- src/_imagingcms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_imagingcms.c b/src/_imagingcms.c index bf0ad7b6380..96a34ac2b5a 100644 --- a/src/_imagingcms.c +++ b/src/_imagingcms.c @@ -854,7 +854,7 @@ _profile_read_named_color_list(CmsProfileObject *self, cmsTagSignature info) { n = cmsNamedColorCount(ncl); result = PyList_New(n); if (!result) { - Py_RETURN_NONE; + return NULL; } for (i = 0; i < n; i++) { @@ -863,7 +863,7 @@ _profile_read_named_color_list(CmsProfileObject *self, cmsTagSignature info) { str = PyUnicode_FromString(name); if (str == NULL) { Py_DECREF(result); - Py_RETURN_NONE; + return NULL; } PyList_SET_ITEM(result, i, str); } @@ -930,7 +930,7 @@ _is_intent_supported(CmsProfileObject *self, int clut) { result = PyDict_New(); if (result == NULL) { - Py_RETURN_NONE; + return NULL; } n = cmsGetSupportedIntents(INTENTS, intent_ids, intent_descs); @@ -960,7 +960,7 @@ _is_intent_supported(CmsProfileObject *self, int clut) { Py_XDECREF(id); Py_XDECREF(entry); Py_XDECREF(result); - Py_RETURN_NONE; + return NULL; } PyDict_SetItem(result, id, entry); Py_DECREF(id);