py3: add PY23() macro to switch string literal depending on python version
I have no better idea to work around the bytes-unicode divergence of
Py_BuildValue(). Maybe we can write a code transformer for C extensions? :)
--- a/mercurial/cext/util.h Sat Mar 03 05:50:45 2018 -0500
+++ b/mercurial/cext/util.h Sat Mar 03 05:58:41 2018 -0500
@@ -14,6 +14,13 @@
#define IS_PY3K
#endif
+/* helper to switch things like string literal depending on Python version */
+#ifdef IS_PY3K
+#define PY23(py2, py3) py3
+#else
+#define PY23(py2, py3) py2
+#endif
+
/* clang-format off */
typedef struct {
PyObject_HEAD