]> granicus.if.org Git - python/commitdiff
bpo-33738: Address review comments in GH #7477 (GH-7585)
authorChristian Tismer <tismer@stackless.com>
Sun, 10 Jun 2018 22:48:28 +0000 (00:48 +0200)
committerNed Deily <nad@python.org>
Sun, 10 Jun 2018 22:48:28 +0000 (18:48 -0400)
Include/abstract.h
Include/pyerrors.h
Misc/NEWS.d/next/Core and Builtins/2018-06-07-18-34-19.bpo-33738.ODZS7a.rst
Objects/abstract.c
Objects/exceptions.c

index e7bc2d24bc22e02c73b93dc30fb779a3986a2305..c1297dbedeab12fcbc09ebf7e5ea2e3624c919e4 100644 (file)
@@ -598,7 +598,7 @@ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
     ((obj)->ob_type->tp_iternext != NULL && \
      (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
 #else
-PyAPI_FUNC(int) PyIter_Check(PyObject*);
+PyAPI_FUNC(int) PyIter_Check(PyObject *);
 #endif
 
 /* Takes an iterator object and calls its tp_iternext slot,
index a9929f5f19f95a0591fd97f541a1b80a2f99bea8..5fd981c2bae96f5b387b5377503a87cdbfafeb2b 100644 (file)
@@ -142,9 +142,9 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
 
 #ifndef Py_LIMITED_API
 #define PyExceptionClass_Name(x) \
-     ((char *)(((PyTypeObject*)(x))->tp_name))
+     ((char *)(((PyTypeObject *)(x))->tp_name))
 #else
-     PyAPI_FUNC(char *) PyExceptionClass_Name(PyObject*);
+     PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *);
 #endif
 
 #define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
index 0d66c4b1f191f2ea04a1e7b65920d4d19e905497..0b7365d05a5f8f44eaeffcb7329df07660bb597d 100644 (file)
@@ -1,3 +1,4 @@
 Seven macro incompatibilities with the Limited API were fixed, and the
 macros PyIter_Check, PyIndex_Check and PyExceptionClass_Name were added as
-functions. A script for automatic macro checks was added.
+functions. The return type of PyExceptionClass_Name is "const char \*".
+A script for automatic macro checks was added.
index e2700e3f80d7d01ba597cc7b5df14adea6c1412d..192ade115789b5497fb456c7d6a5b7f111aeee5d 100644 (file)
@@ -1245,6 +1245,7 @@ PyNumber_Absolute(PyObject *o)
 }
 
 #undef PyIndex_Check
+
 int
 PyIndex_Check(PyObject *obj)
 {
@@ -2544,6 +2545,7 @@ PyObject_GetIter(PyObject *o)
 }
 
 #undef PyIter_Check
+
 int PyIter_Check(PyObject *obj)
 {
     return obj->ob_type->tp_iternext != NULL &&
index bcb1fd5d07c5cb41c5c8ac703a0f620eded133c8..7beb2a2891de7195e8af71840bc39bcb14d49d31 100644 (file)
@@ -343,6 +343,7 @@ PyException_SetContext(PyObject *self, PyObject *context)
 }
 
 #undef PyExceptionClass_Name
+
 char *
 PyExceptionClass_Name(PyObject *ob)
 {