Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cext/revlog.c @ 36649:186c6df3a373
py3: bulk-replace 'const char*' format specifier passed to PyArg_ParseTuple*()
Perhaps we need this because 's' accepts a unicode string.
https://docs.python.org/3/c-api/arg.html#strings-and-buffers
Substituted using the following pattern with some manual fixes:
'\b(PyArg_ParseTuple)\((\s*\w+,\s*)"([^"]+)"'
'\b(PyArg_ParseTupleAndKeywords)\((\s*\w+,\s*\w+,\s*)"([^"]+)"'
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Mar 2018 06:18:47 -0500 |
parents | 1f8c3fadbb8e |
children | 4015b9248da0 |
line wrap: on
line diff
--- a/mercurial/cext/revlog.c Sat Mar 03 06:08:22 2018 -0500 +++ b/mercurial/cext/revlog.c Sat Mar 03 06:18:47 2018 -0500 @@ -1243,7 +1243,7 @@ char *node; int rev, i; - if (!PyArg_ParseTuple(args, "s#", &node, &nodelen)) + if (!PyArg_ParseTuple(args, PY23("s#", "y#"), &node, &nodelen)) return NULL; if (nodelen < 4) {