]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py3: Remove #define IsPy3Bytes PyBytes_Check
authorAndrew Bartlett <abartlet@samba.org>
Sat, 14 Mar 2020 21:40:46 +0000 (10:40 +1300)
committerNoel Power <npower@samba.org>
Mon, 23 Mar 2020 19:12:43 +0000 (19:12 +0000)
This allows us to end the use of Python 2/3 compatability macros.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
python/py3compat.h
source4/librpc/ndr/py_misc.c

index ea5366a84347d23a1b252926a58468aec3911848..516495e4e5ac32a309d372c5fbe94b418a245783 100644 (file)
@@ -62,8 +62,6 @@
  * will work as expected in python2 & python3
  */
 
-#define IsPy3Bytes PyBytes_Check
-
 #define IsPy3BytesOrString(pystr) \
     (PyUnicode_Check(pystr) || PyBytes_Check(pystr))
 
index 975235490ad8a306aa096708cb798f9db53c6277..81e762af3281ac5b559ee27482c4086886a99d13 100644 (file)
@@ -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));