Skip to content

Conversation

@radarhere
Copy link
Member

#8216 has changed the code to return early if axis_name is NULL.

Pillow/src/_imagingft.c

Lines 1311 to 1319 in 6944e9e

axis_name = Py_BuildValue("y#", name.string, name.string_len);
if (axis_name == NULL) {
Py_DECREF(list_axis);
Py_DECREF(list_axes);
FT_Done_MM_Var(library, master);
return NULL;
}
PyDict_SetItemString(
list_axis, "name", axis_name ? axis_name : Py_None);

So the ternary condition can be removed.

Copy link
Contributor

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I missed this while working on this part of the code. Thanks for noticing!

@hugovk hugovk merged commit 2152a17 into python-pillow:main Jul 15, 2024
@radarhere radarhere deleted the axis_name branch July 15, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants