Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 77283:2285a82504dc
check return for error
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Fri, 01 Jun 2012 11:18:22 -0700 |
| parents | b0eb7d2a9542 |
| children | cfbf6aa5c9e3 |
line wrap: on
line diff
--- a/Python/ceval.c Fri Jun 01 22:48:32 2012 +1000 +++ b/Python/ceval.c Fri Jun 01 11:18:22 2012 -0700 @@ -3107,6 +3107,8 @@ 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);
