Mercurial > hg
comparison mercurial/cext/parsers.c @ 42096:509a0477b3a6
cext: cast s# arguments of Py_BuildValue() to Py_ssize_t
The doc doesn't state that "s#" of Py_BuildValue() is controlled by
PY_SSIZE_T_CLEAN (unlike the one for PyArg_ParseTuple()), but actually
it's switched to Py_ssize_t.
https://docs.python.org/2/c-api/arg.html#c.Py_BuildValue
https://github.com/python/cpython/blob/2.7/Python/modsupport.c#L432
Follow up for b01bbb8ff1f2 and 896b19d12c08.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 09 Apr 2019 21:59:37 +0900 |
parents | 896b19d12c08 |
children | e240bec26626 |
comparison
equal
deleted
inserted
replaced
42095:864f9f63d3ed | 42096:509a0477b3a6 |
---|---|
182 PyErr_SetString(PyExc_ValueError, | 182 PyErr_SetString(PyExc_ValueError, |
183 "too little data for parents"); | 183 "too little data for parents"); |
184 goto quit; | 184 goto quit; |
185 } | 185 } |
186 | 186 |
187 parents = Py_BuildValue(PY23("s#s#", "y#y#"), str, 20, str + 20, 20); | 187 parents = Py_BuildValue(PY23("s#s#", "y#y#"), str, (Py_ssize_t)20, |
188 str + 20, (Py_ssize_t)20); | |
188 if (!parents) { | 189 if (!parents) { |
189 goto quit; | 190 goto quit; |
190 } | 191 } |
191 | 192 |
192 /* read filenames */ | 193 /* read filenames */ |