diff mercurial/cext/pathencode.c @ 48821:b0dd39b91e7a

cext: remove PY23() Since we always run on Python 3 now, we no longer need this macro to support Python 2. We refactor all users to just use the 2nd argument. Differential Revision: https://phab.mercurial-scm.org/D12232
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 20 Feb 2022 16:09:02 -0700
parents e35807332598
children
line wrap: on
line diff
--- a/mercurial/cext/pathencode.c	Sun Feb 20 16:13:57 2022 -0700
+++ b/mercurial/cext/pathencode.c	Sun Feb 20 16:09:02 2022 -0700
@@ -535,8 +535,7 @@
 	Py_ssize_t len, newlen;
 	PyObject *ret;
 
-	if (!PyArg_ParseTuple(args, PY23("s#:lowerencode", "y#:lowerencode"),
-	                      &path, &len)) {
+	if (!PyArg_ParseTuple(args, "y#:lowerencode", &path, &len)) {
 		return NULL;
 	}
 
@@ -711,7 +710,7 @@
 		}
 	}
 
-	shaobj = PyObject_CallFunction(shafunc, PY23("s#", "y#"), str, len);
+	shaobj = PyObject_CallFunction(shafunc, "y#", str, len);
 
 	if (shaobj == NULL) {
 		return -1;