diff mercurial/cext/base85.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 e1138fc2c4e2
children 91477b123700
line wrap: on
line diff
--- a/mercurial/cext/base85.c	Sat Mar 03 06:08:22 2018 -0500
+++ b/mercurial/cext/base85.c	Sat Mar 03 06:18:47 2018 -0500
@@ -37,7 +37,7 @@
 	unsigned int acc, val, ch;
 	int pad = 0;
 
-	if (!PyArg_ParseTuple(args, "s#|i", &text, &len, &pad))
+	if (!PyArg_ParseTuple(args, PY23("s#|i", "y#|i"), &text, &len, &pad))
 		return NULL;
 
 	if (pad)
@@ -84,7 +84,7 @@
 	int c;
 	unsigned int acc;
 
-	if (!PyArg_ParseTuple(args, "s#", &text, &len))
+	if (!PyArg_ParseTuple(args, PY23("s#", "y#"), &text, &len))
 		return NULL;
 
 	olen = len / 5 * 4;