summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-06-01 18:18:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-06-01 18:18:22 (GMT)
commitd1ab6089ff2b4f1277676a5feac11d311b2c52ab (patch)
tree324c138f2072605f2be1198d4375b8c0332bb39e /Python/ceval.c
parent77452fc12121a333397ea262a3d29bdb8cbc7a57 (diff)
downloadcpython-d1ab6089ff2b4f1277676a5feac11d311b2c52ab.zip
cpython-d1ab6089ff2b4f1277676a5feac11d311b2c52ab.tar.gz
cpython-d1ab6089ff2b4f1277676a5feac11d311b2c52ab.tar.bz2
check return for error
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 718bb32..b3ec013 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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);