# HG changeset patch # User Henrik Stuart # Date 2014-09-11 17:05:23 # Node ID 888bc106de8361f2605d53704b46632a2ee30c3e # Parent 9f490afcb067bc15983dfeca891be67bb6e951e3 parsers: fix typing issue when constructing Python integer object The passed variable is a Py_ssize_t, not a long, and consequently should use PyInt_FromSsize_t rather than PyInt-FromLong. Fixed based on warning from Microsoft Visual C++ 2008. diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -881,7 +881,7 @@ static PyObject *index_headrevs(indexObj if (nothead[i]) continue; - head = PyInt_FromLong(i); + head = PyInt_FromSsize_t(i); if (head == NULL || PyList_Append(heads, head) == -1) { Py_XDECREF(head); goto bail;