[fix] Error condition in Python tokenize

This commit is contained in:
Al
2015-10-27 13:33:28 -04:00
parent 6aaa08c220
commit 9f6e1387a0

View File

@@ -75,7 +75,7 @@ static PyObject *py_tokenize(PyObject *self, PyObject *args)
for (size_t i = 0; i < tokens->n; i++) {
token = tokens->a[i];
tuple = Py_BuildValue("III", token.offset, token.len, token.type);
if (!PyTuple_SetItem(result, i, tuple) < 0) {
if (PyTuple_SetItem(result, i, tuple) < 0) {
token_array_destroy(tokens);
goto error_decref_str;
}