Commit 8398713c authored by Christian Tismer's avatar Christian Tismer Committed by Ned Deily

bpo-33738: Address review comments in GH #7477 (GH-7585)

parent 877b2320
......@@ -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,
......
......@@ -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))
......
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.
......@@ -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 &&
......
......@@ -343,6 +343,7 @@ PyException_SetContext(PyObject *self, PyObject *context)
}
#undef PyExceptionClass_Name
char *
PyExceptionClass_Name(PyObject *ob)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment