[Python-checkins] cpython (merge 3.5 -> default): Issue 24365: Merge 3.5

yury.selivanov python-checkins at python.org
Wed Jun 3 01:14:41 CEST 2015


https://hg.python.org/cpython/rev/fd265fa89c36
changeset:   96490:fd265fa89c36
parent:      96488:54459fdf2bca
parent:      96489:c835dd16539a
user:        Yury Selivanov <yselivanov at sprymix.com>
date:        Tue Jun 02 19:07:17 2015 -0400
summary:
  Issue 24365: Merge 3.5

files:
  Include/modsupport.h   |   9 +++++++-
  Include/moduleobject.h |  32 ++++++++++++++++++-----------
  Include/typeslots.h    |   3 ++
  3 files changed, 31 insertions(+), 13 deletions(-)


diff --git a/Include/modsupport.h b/Include/modsupport.h
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -49,9 +49,13 @@
 PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);
 #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
 #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)
+
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
 PyAPI_FUNC(int) PyModule_SetDocString(PyObject *, const char *);
 PyAPI_FUNC(int) PyModule_AddFunctions(PyObject *, PyMethodDef *);
 PyAPI_FUNC(int) PyModule_ExecDef(PyObject *module, PyModuleDef *def);
+#endif
 
 #define Py_CLEANUP_SUPPORTED 0x20000
 
@@ -126,6 +130,8 @@
         PyModule_Create2(module, PYTHON_API_VERSION)
 #endif
 
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
 PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
                                                 PyObject *spec,
                                                 int module_api_version);
@@ -136,7 +142,8 @@
 #else
 #define PyModule_FromDefAndSpec(module, spec) \
     PyModule_FromDefAndSpec2(module, spec, PYTHON_API_VERSION)
-#endif
+#endif /* Py_LIMITED_API */
+#endif /* New in 3.5 */
 
 #ifndef Py_LIMITED_API
 PyAPI_DATA(char *) _Py_PackageContext;
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -30,8 +30,11 @@
 PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
 PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
 
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
 PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*);
 PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
+#endif
 
 typedef struct PyModuleDef_Base {
   PyObject_HEAD
@@ -47,23 +50,14 @@
     NULL, /* m_copy */          \
   }
 
+struct PyModuleDef_Slot;
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
 typedef struct PyModuleDef_Slot{
     int slot;
     void *value;
 } PyModuleDef_Slot;
 
-typedef struct PyModuleDef{
-  PyModuleDef_Base m_base;
-  const char* m_name;
-  const char* m_doc;
-  Py_ssize_t m_size;
-  PyMethodDef *m_methods;
-  PyModuleDef_Slot* m_slots;
-  traverseproc m_traverse;
-  inquiry m_clear;
-  freefunc m_free;
-}PyModuleDef;
-
 #define Py_mod_create 1
 #define Py_mod_exec 2
 
@@ -71,6 +65,20 @@
 #define _Py_mod_LAST_SLOT 2
 #endif
 
+#endif /* New in 3.5 */
+
+typedef struct PyModuleDef{
+  PyModuleDef_Base m_base;
+  const char* m_name;
+  const char* m_doc;
+  Py_ssize_t m_size;
+  PyMethodDef *m_methods;
+  struct PyModuleDef_Slot* m_slots;
+  traverseproc m_traverse;
+  inquiry m_clear;
+  freefunc m_free;
+}PyModuleDef;
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Include/typeslots.h b/Include/typeslots.h
--- a/Include/typeslots.h
+++ b/Include/typeslots.h
@@ -79,4 +79,7 @@
 #define Py_am_await 77
 #define Py_am_aiter 78
 #define Py_am_anext 79
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
 #define Py_tp_finalize 80
+#endif

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list