From: Andrew Bartlett Date: Sat, 14 Mar 2020 21:40:46 +0000 (+1300) Subject: py3: Remove #define IsPy3Bytes PyBytes_Check X-Git-Tag: ldb-2.2.0~1276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=675ab9d6ae6f5cd95ddde51d19774cae7ecc11ca;p=thirdparty%2Fsamba.git py3: Remove #define IsPy3Bytes PyBytes_Check This allows us to end the use of Python 2/3 compatability macros. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/python/py3compat.h b/python/py3compat.h index ea5366a8434..516495e4e5a 100644 --- a/python/py3compat.h +++ b/python/py3compat.h @@ -62,8 +62,6 @@ * will work as expected in python2 & python3 */ -#define IsPy3Bytes PyBytes_Check - #define IsPy3BytesOrString(pystr) \ (PyUnicode_Check(pystr) || PyBytes_Check(pystr)) diff --git a/source4/librpc/ndr/py_misc.c b/source4/librpc/ndr/py_misc.c index 975235490ad..81e762af328 100644 --- a/source4/librpc/ndr/py_misc.c +++ b/source4/librpc/ndr/py_misc.c @@ -102,7 +102,7 @@ static int py_GUID_init(PyObject *self, PyObject *args, PyObject *kwargs) return -1; } - if (!IsPy3Bytes(str)) { + if (!PyBytes_Check(str)) { guid_val.data = discard_const_p(uint8_t, PyUnicode_AsUTF8AndSize(str, &_size));