[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Thu Jun 6 13:27:02 UTC 2019


The branch, master has been updated
       via  0d4738ee3b2 py3: Remove unused PyInt_AsSsize_t macro from py3compat.h
       via  88d62288dd4 py3: Remove unused PyInt_AsUnsignedLongLongMask macro from py3compat.h
       via  6e2e80a4d2b py3: Remove unused PyInt_AS_LONG macro from py3compat.h
       via  03cb50cf58f py3: Remove unused PyInt_FromSize_t macro from py3compat.h
       via  f3523991525 py3: Remove unused PyInt_FromSsize_t macro from py3compat.h
       via  7bd3d0f79be py3: Remove unused PyInt_FromString macro from py3compat.h
       via  09fecb67753 py3: Remove unused PyInt_CheckExact macro from py3compat.h
       via  2dfcf652acf py3: Remove unused PY_DESC_PY3_STRING macro from py3compat.h
       via  5c15e68bb1e py3: Remove unused PyStr_AsUTF8String macro from py3compat.h
       via  a5b04db676e py3: Remove unused PyStr_Decode macro from py3compat.h
       via  1c92e7bdea0 py3: Remove unused PyStr_InternFromString macro from py3compat.h
       via  e6da3fcfbe9 py3: Remove unused PyStr_InternInPlace macro from py3compat.h
       via  e191788c065 py3: Remove unused PyStr_Format macro from py3compat.h
       via  00718304e9a py3: Remove unused PyStr_Concat macro from py3compat.h
       via  cff26b47eef py3: Remove unused PyStr_CheckExact macro from py3compat.h
       via  6a8c7adc5a4 py3: Remove unused IS_PY3 macro from py3compat.h
       via  0b81dca2572 py3: Remove Python2 side of py3compat.h
      from  7680010e3bc tests blackbox ndrdump: Clean up pep8 warnings

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0d4738ee3b220476a23b3e30962881dec2cf5f72
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 06:04:19 2019 +0200

    py3: Remove unused PyInt_AsSsize_t macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Jun  6 13:26:05 UTC 2019 on sn-devel-184

commit 88d62288dd4a3c7eb00603c3a9fc5d1c9c73e51f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 06:02:49 2019 +0200

    py3: Remove unused PyInt_AsUnsignedLongLongMask macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 6e2e80a4d2b31055ec91316aed6fdb488b40f697
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 06:02:02 2019 +0200

    py3: Remove unused PyInt_AS_LONG macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 03cb50cf58f770c1b09b3ef95b7584821b7ffb72
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 06:01:16 2019 +0200

    py3: Remove unused PyInt_FromSize_t macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit f35239915252e1644134bf0eb55e18540a6d20d9
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 06:00:41 2019 +0200

    py3: Remove unused PyInt_FromSsize_t macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 7bd3d0f79be8464b63815da8db9c0ec205da5e6e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:59:56 2019 +0200

    py3: Remove unused PyInt_FromString macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 09fecb677530fb9fedbc5c68cffca09270340bf0
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:59:17 2019 +0200

    py3: Remove unused PyInt_CheckExact macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 2dfcf652acf89ee55464d464bdc49902db52a431
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:57:43 2019 +0200

    py3: Remove unused PY_DESC_PY3_STRING macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 5c15e68bb1e79cd4f3f2590f9cadf00253aa788c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:54:36 2019 +0200

    py3: Remove unused PyStr_AsUTF8String macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit a5b04db676ee73df2f5dd98096ee849c6a0447fa
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:53:44 2019 +0200

    py3: Remove unused PyStr_Decode macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 1c92e7bdea0b9d65f05475584e36852db9744599
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:52:54 2019 +0200

    py3: Remove unused PyStr_InternFromString macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit e6da3fcfbe9a3d54cf08887e3232a75e76df0f8a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:52:07 2019 +0200

    py3: Remove unused PyStr_InternInPlace macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit e191788c0654c80d9e9defff080049bfb3115fbf
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:50:49 2019 +0200

    py3: Remove unused PyStr_Format macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 00718304e9a01b5ee8b0a5cf4e7fa323ca85b032
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:50:19 2019 +0200

    py3: Remove unused PyStr_Concat macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit cff26b47eeffe1080fff1c794bbe4dcb8e7b6aed
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:48:07 2019 +0200

    py3: Remove unused PyStr_CheckExact macro from py3compat.h
    
    Now that we are no longer developing new py2/py3 compatible code we can remove
    any aspects of this header we do not use.  This will make the eventual removal
    easier.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 6a8c7adc5a454154904aa3b0fe52aef0b78ab7d6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 6 05:46:27 2019 +0200

    py3: Remove unused IS_PY3 macro from py3compat.h
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

commit 0b81dca2572ee98fdb5f61652c3fb1ce30cd0a9b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jun 5 17:13:00 2019 +0200

    py3: Remove Python2 side of py3compat.h
    
    This is unused as we do not support building python modules (etc) under py2.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 python/py3compat.h | 117 +----------------------------------------------------
 1 file changed, 1 insertion(+), 116 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/py3compat.h b/python/py3compat.h
index 89b7552c791..a131cbef368 100644
--- a/python/py3compat.h
+++ b/python/py3compat.h
@@ -22,8 +22,6 @@
 #include <Python.h>
 
 /* Quick docs:
- *
- * The IS_PY3 preprocessor constant is 1 on Python 3, and 0 on Python 2.
  *
  * "PyStr_*" works like PyUnicode_* on Python 3, but uses bytestrings (str)
  * under Python 2.
@@ -52,35 +50,23 @@
  *
  */
 
-#if PY_MAJOR_VERSION >= 3
-
 /***** Python 3 *****/
 
-#define IS_PY3 1
-
 /* Strings */
 
 #define PyStr_Type PyUnicode_Type
 #define PyStr_Check PyUnicode_Check
-#define PyStr_CheckExact PyUnicode_CheckExact
 #define PyStr_FromString PyUnicode_FromString
 #define PyStr_FromStringAndSize PyUnicode_FromStringAndSize
 #define PyStr_FromFormat PyUnicode_FromFormat
 #define PyStr_FromFormatV PyUnicode_FromFormatV
 #define PyStr_AsString PyUnicode_AsUTF8
-#define PyStr_Concat PyUnicode_Concat
-#define PyStr_Format PyUnicode_Format
-#define PyStr_InternInPlace PyUnicode_InternInPlace
-#define PyStr_InternFromString PyUnicode_InternFromString
-#define PyStr_Decode PyUnicode_Decode
 
-#define PyStr_AsUTF8String PyUnicode_AsUTF8String // returns PyBytes
 #define PyStr_AsUTF8 PyUnicode_AsUTF8
 #define PyStr_AsUTF8AndSize PyUnicode_AsUTF8AndSize
 
-/* description of bytes and string objects */
+/* description of bytes objects */
 #define PY_DESC_PY3_BYTES "bytes"
-#define PY_DESC_PY3_STRING "string"
 
 /* Determine if object is really bytes, for code that runs
  * in python2 & python3 (note: PyBytes_Check is replaced by
@@ -99,15 +85,8 @@
 
 #define PyInt_Type PyLong_Type
 #define PyInt_Check PyLong_Check
-#define PyInt_CheckExact PyLong_CheckExact
-#define PyInt_FromString PyLong_FromString
 #define PyInt_FromLong PyLong_FromLong
-#define PyInt_FromSsize_t PyLong_FromSsize_t
-#define PyInt_FromSize_t PyLong_FromSize_t
 #define PyInt_AsLong PyLong_AsLong
-#define PyInt_AS_LONG PyLong_AS_LONG
-#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
-#define PyInt_AsSsize_t PyLong_AsSsize_t
 
 /* Module init */
 
@@ -120,98 +99,4 @@
 #define PYARG_BYTES_LEN "y#"
 #define PYARG_STR_UNI "es"
 
-#else
-
-/***** Python 2 *****/
-
-#define IS_PY3 0
-
-/* Strings */
-
-#define PyStr_Type PyString_Type
-#define PyStr_Check PyString_Check
-#define PyStr_CheckExact PyString_CheckExact
-#define PyStr_FromString PyString_FromString
-#define PyStr_FromStringAndSize PyString_FromStringAndSize
-#define PyStr_FromFormat PyString_FromFormat
-#define PyStr_FromFormatV PyString_FromFormatV
-#define PyStr_AsString PyString_AsString
-#define PyStr_Format PyString_Format
-#define PyStr_InternInPlace PyString_InternInPlace
-#define PyStr_InternFromString PyString_InternFromString
-#define PyStr_Decode PyString_Decode
-
-#define PyStr_AsUTF8String(str) (Py_INCREF(str), (str))
-#define PyStr_AsUTF8 PyString_AsString
-#define PyStr_AsUTF8AndSize(pystr, sizeptr) \
-    ((*sizeptr=PyString_Size(pystr)), PyString_AsString(pystr))
-
-#define PyBytes_Type PyString_Type
-#define PyBytes_Check PyString_Check
-#define PyBytes_CheckExact PyString_CheckExact
-#define PyBytes_FromString PyString_FromString
-#define PyBytes_FromStringAndSize PyString_FromStringAndSize
-#define PyBytes_FromFormat PyString_FromFormat
-#define PyBytes_FromFormatV PyString_FromFormatV
-#define PyBytes_Size PyString_Size
-#define PyBytes_GET_SIZE PyString_GET_SIZE
-#define PyBytes_AsString PyString_AsString
-#define PyBytes_AS_STRING PyString_AS_STRING
-#define PyBytes_AsStringAndSize PyString_AsStringAndSize
-#define PyBytes_Concat PyString_Concat
-#define PyBytes_ConcatAndDel PyString_ConcatAndDel
-#define _PyBytes_Resize _PyString_Resize
-
-/* description of bytes and string objects */
-#define PY_DESC_PY3_BYTES "string"
-#define PY_DESC_PY3_STRING "unicode"
-
-/* Determine if object is really bytes, for code that runs
- * in python2 & python3 (note: PyBytes_Check is replaced by
- * PyString_Check in python2) so care needs to be taken when
- * writing code that will check if incoming type is bytes that
- * will work as expected in python2 & python3
- */
-
-#define IsPy3Bytes(pystr) false
-
-#define IsPy3BytesOrString PyStr_Check
-
-/* PyArg_ParseTuple/Py_BuildValue argument */
-
-#define PYARG_BYTES_LEN "s#"
-/*
- * We want a format that will ensure unicode is encoded using the
- * specified encoding 'utf8' (to obtain the char* array)
- * In python3 we use "es" but in python2 the specifiying 'es' will
- * result in the any incomming 'str' type being decoded first to ascii
- * then encoded to the specified 'utf8' encoding. In order to avoid that
- * we use format 'et' in python2 instead.
- */
-#define PYARG_STR_UNI "et"
-
-/* Module init */
-
-#define PyModuleDef_HEAD_INIT 0
-
-typedef struct PyModuleDef {
-    int m_base;
-    const char* m_name;
-    const char* m_doc;
-    Py_ssize_t m_size;
-    PyMethodDef *m_methods;
-} PyModuleDef;
-
-#define PyModule_Create(def) \
-    Py_InitModule3((def)->m_name, (def)->m_methods, (def)->m_doc)
-
-#define MODULE_INIT_FUNC(name) \
-    static PyObject *PyInit_ ## name(void); \
-    void init ## name(void); \
-    void init ## name(void) { PyInit_ ## name(); } \
-    static PyObject *PyInit_ ## name(void)
-
-
-#endif
-
 #endif


-- 
Samba Shared Repository



More information about the samba-cvs mailing list