Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1ab608

Browse files
committed
check return for error
1 parent 77452fc commit d1ab608

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/ceval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,6 +3107,8 @@ format_missing(const char *kind, PyCodeObject *co, PyObject *names)
31073107
tail = PyUnicode_FromFormat(", %U, and %U",
31083108
PyList_GET_ITEM(names, len - 2),
31093109
PyList_GET_ITEM(names, len - 1));
3110+
if (tail == NULL)
3111+
return;
31103112
/* Chop off the last two objects in the list. This shouldn't actually
31113113
fail, but we can't be too careful. */
31123114
err = PyList_SetSlice(names, len - 2, len, NULL);

0 commit comments

Comments
 (0)