X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/ad8cdbeb542edc489490e9837e54da82ac1a8fe3..efde4c99dae1a3ad56610e05d3a23b195060041e:/catacomb.c diff --git a/catacomb.c b/catacomb.c index edb0c4a..d82ed7c 100644 --- a/catacomb.c +++ b/catacomb.c @@ -76,7 +76,8 @@ PyObject *mexp_common(PyObject *me, PyObject *arg, arg = PyTuple_GetItem(arg, 0); Py_INCREF(arg); if (!PySequence_Check(arg)) TYERR("not a sequence"); - n = PySequence_Size(arg); if (!n) { z = id(me); goto end; } + n = PySequence_Size(arg); if (n < 0) goto end; + if (!n) { z = id(me); goto end; } x = PySequence_GetItem(arg, 0); if (PySequence_Check(x)) flat = 0;