]> granicus.if.org Git - python/commitdiff
check return for error
authorBenjamin Peterson <benjamin@python.org>
Fri, 1 Jun 2012 18:18:22 +0000 (11:18 -0700)
committerBenjamin Peterson <benjamin@python.org>
Fri, 1 Jun 2012 18:18:22 +0000 (11:18 -0700)
Python/ceval.c

index 718bb32b5623569649355600734ebe66c3e0f352..b3ec013e1711c04a6b4fb923f4e2005a9fbe8bab 100644 (file)
@@ -3107,6 +3107,8 @@ format_missing(const char *kind, PyCodeObject *co, PyObject *names)
         tail = PyUnicode_FromFormat(", %U, and %U",
                                     PyList_GET_ITEM(names, len - 2),
                                     PyList_GET_ITEM(names, len - 1));
+        if (tail == NULL)
+            return;
         /* Chop off the last two objects in the list. This shouldn't actually
            fail, but we can't be too careful. */
         err = PyList_SetSlice(names, len - 2, len, NULL);