py3: Remove PyStr_FromFormatV() compatability macro
authorAndrew Bartlett <abartlet@samba.org>
Fri, 7 Jun 2019 09:13:03 +0000 (11:13 +0200)
committerNoel Power <npower@samba.org>
Mon, 24 Jun 2019 17:24:27 +0000 (17:24 +0000)
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 <abartlet@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
lib/ldb/pyldb.c
python/py3compat.h

index 456be0b79f6882265c7f0e60fbbcb110f1ea6b3d..148faf5bc320a72501a3534fc86663815246d479 100644 (file)
@@ -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;
index b1d2206bf8f19a184b1f997c06e13670fd393ba5..2db77d1b1ddb547a651f488bef9ba0e0551218cd 100644 (file)
@@ -54,7 +54,6 @@
 
 /* Strings */
 
-#define PyStr_FromFormatV PyUnicode_FromFormatV
 #define PyStr_AsString PyUnicode_AsUTF8
 
 #define PyStr_AsUTF8 PyUnicode_AsUTF8