chiark
/
gitweb
/
~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ec.c: Fix length type which should have been `Py_ssize_t'.
[catacomb-python]
/
algorithms.c
diff --git
a/algorithms.c
b/algorithms.c
index d60fe3efb87e5b46e99b56b3c33c20309944ee17..edd73fd8119224577430b7aa7062bc990a58453c 100644
(file)
--- 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");
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);
if (dfl < 0) VALERR("key size cannot be negative");
x = PyInt_FromLong(dfl);
PyList_Append(l, x);