diff mercurial/cext/mpatch.c @ 36620: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 a2d11d23bb25
children 77492c10a35b
line wrap: on
line diff
--- a/mercurial/cext/mpatch.c	Sat Mar 03 06:08:22 2018 -0500
+++ b/mercurial/cext/mpatch.c	Sat Mar 03 06:18:47 2018 -0500
@@ -134,7 +134,7 @@
 	Py_ssize_t patchlen;
 	char *bin;
 
-	if (!PyArg_ParseTuple(args, "ls#", &orig, &bin, &patchlen))
+	if (!PyArg_ParseTuple(args, PY23("ls#", "ly#"), &orig, &bin, &patchlen))
 		return NULL;
 
 	while (pos >= 0 && pos < patchlen) {