From: Andrew Bartlett Date: Fri, 7 Jun 2019 09:13:03 +0000 (+0200) Subject: py3: Remove PyStr_FromFormatV() compatability macro X-Git-Tag: ldb-2.0.5~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9d9463fd3c7eda14a3170e214d6a56c9efbbcec;p=thirdparty%2Fsamba.git py3: Remove PyStr_FromFormatV() compatability macro We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 456be0b79f6..148faf5bc32 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -85,7 +85,6 @@ static struct ldb_message_element *PyObject_AsMessageElement( static PyTypeObject PyLdbBytesType; #if PY_MAJOR_VERSION >= 3 -#define PyStr_FromFormatV PyUnicode_FromFormatV #define PyStr_AsUTF8 PyUnicode_AsUTF8 #define PyStr_AsUTF8AndSize PyUnicode_AsUTF8AndSize #define PyInt_FromLong PyLong_FromLong @@ -102,7 +101,6 @@ static PyObject *PyLdbBytes_FromStringAndSize(const char *msg, int size) return result; } #else -#define PyStr_FromFormatV PyString_FromFormatV #define PyStr_AsUTF8 PyString_AsString #define PyLdbBytes_FromStringAndSize PyString_FromStringAndSize @@ -988,7 +986,7 @@ static void py_ldb_debug(void *context, enum ldb_debug_level level, const char * static void py_ldb_debug(void *context, enum ldb_debug_level level, const char *fmt, va_list ap) { PyObject *fn = (PyObject *)context; - PyObject_CallFunction(fn, discard_const_p(char, "(i,O)"), level, PyStr_FromFormatV(fmt, ap)); + PyObject_CallFunction(fn, discard_const_p(char, "(i,O)"), level, PyUnicode_FromFormatV(fmt, ap)); } static PyObject *py_ldb_debug_func; diff --git a/python/py3compat.h b/python/py3compat.h index b1d2206bf8f..2db77d1b1dd 100644 --- a/python/py3compat.h +++ b/python/py3compat.h @@ -54,7 +54,6 @@ /* Strings */ -#define PyStr_FromFormatV PyUnicode_FromFormatV #define PyStr_AsString PyUnicode_AsUTF8 #define PyStr_AsUTF8 PyUnicode_AsUTF8