diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-06-07 11:01:19 +0200 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-06-24 17:24:27 +0000 |
commit | 3fa00d435045e6faeb92f5379684f118b131c92c (patch) | |
tree | 0857fd5576d31c9423629b0e81d821e13e997d7f /lib/ldb | |
parent | 34f9a089d8d3a8971b2f7ee45f6d8e823a52a193 (diff) | |
download | samba-3fa00d435045e6faeb92f5379684f118b131c92c.tar.gz |
py3: Remove PyStr_FromStringAndSize() 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 <abartlet@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'lib/ldb')
-rw-r--r-- | lib/ldb/pyldb.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 6f43cca78ca..958c3afab57 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_FromStringAndSize PyUnicode_FromStringAndSize #define PyStr_FromFormat PyUnicode_FromFormat #define PyStr_FromFormatV PyUnicode_FromFormatV #define PyStr_AsUTF8 PyUnicode_AsUTF8 @@ -104,7 +103,6 @@ static PyObject *PyLdbBytes_FromStringAndSize(const char *msg, int size) return result; } #else -#define PyStr_FromStringAndSize PyString_FromStringAndSize #define PyStr_FromFormat PyString_FromFormat #define PyStr_FromFormatV PyString_FromFormatV #define PyStr_AsUTF8 PyString_AsString @@ -326,7 +324,7 @@ static PyObject *PyObject_FromLdbValue(const struct ldb_val *val) static PyObject *PyStr_FromLdbValue(const struct ldb_val *val) { - return PyStr_FromStringAndSize((const char *)val->data, val->length); + return PyUnicode_FromStringAndSize((const char *)val->data, val->length); } /** @@ -3322,7 +3320,7 @@ static PyObject *py_ldb_msg_element_str(PyLdbMessageElementObject *self) struct ldb_message_element *el = pyldb_MessageElement_AsMessageElement(self); if (el->num_values == 1) - return PyStr_FromStringAndSize((char *)el->values[0].data, el->values[0].length); + return PyUnicode_FromStringAndSize((char *)el->values[0].data, el->values[0].length); else Py_RETURN_NONE; } |