From 9f6e1387a0268e0bfd0f2bda2e00b4f3cb982d65 Mon Sep 17 00:00:00 2001 From: Al Date: Tue, 27 Oct 2015 13:33:28 -0400 Subject: [PATCH] [fix] Error condition in Python tokenize --- python/postal/text/pytokenize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/postal/text/pytokenize.c b/python/postal/text/pytokenize.c index 8f98d956..ae366b08 100644 --- a/python/postal/text/pytokenize.c +++ b/python/postal/text/pytokenize.c @@ -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; }