X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/5e68fc2a078997337ca62924cd3fd481d172e42b..4281a7ee8646165a39f03bcab908b30dee643dae:/algorithms.c diff --git a/algorithms.c b/algorithms.c index d60fe3e..edd73fd 100644 --- a/algorithms.c +++ b/algorithms.c @@ -138,9 +138,8 @@ static PyObject *keyszset_pynew(PyTypeObject *ty, if (!set) set = PyTuple_New(0); else Py_INCREF(set); if (!PySequence_Check(set)) TYERR("want a sequence"); - n = PySequence_Size(set); - l = PyList_New(0); - if (PyErr_Occurred()) goto end; + n = PySequence_Size(set); if (n < 0) goto end; + l = PyList_New(0); if (!l) goto end; if (dfl < 0) VALERR("key size cannot be negative"); x = PyInt_FromLong(dfl); PyList_Append(l, x);