X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/0ac046f695ce229ffb6220b2db7d04d78c730cc5..b17bbe3b35b75635dbce8e1ffe766f9cd8fb4ecf:/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;