Submitter | Mads Kiilerich |
---|---|
Date | Oct. 20, 2014, 2:56 a.m. |
Message ID | <7fba8c8c403bb9ff9e4e.1413773810@localhost.localdomain> |
Download | mbox | patch |
Permalink | /patch/6415/ |
State | Accepted |
Headers | show |
Comments
On 10/19/2014 07:56 PM, Mads Kiilerich wrote: > parsers: replace Py_BuildValue 'n' with 'k' for Python 2.4 compatibility > > 'n' was introduced in Mercurial in 2b5940f64750 and in Python in 2.5. > > Not a good solution, but good is not an option when we have to support Python > 2.4. Can you be a bit mroe specific about what 'n and 'k mean here. And behavior change this change introduce?
Patch
diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -873,12 +873,12 @@ static PyObject *list_copy(PyObject *lis return newlist; } -static int check_filter(PyObject *filter, Py_ssize_t arg) { +static int check_filter(PyObject *filter, unsigned long arg) { if (filter) { PyObject *arglist, *result; int isfiltered; - arglist = Py_BuildValue("(n)", arg); + arglist = Py_BuildValue("(k)", arg); if (!arglist) { return -1; }