Skip to content

Commit 8398713

Browse files
ctismerned-deily
authored andcommitted
bpo-33738: Address review comments in GH #7477 (GH-7585)
1 parent 877b232 commit 8398713

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

Include/abstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
598598
((obj)->ob_type->tp_iternext != NULL && \
599599
(obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
600600
#else
601-
PyAPI_FUNC(int) PyIter_Check(PyObject*);
601+
PyAPI_FUNC(int) PyIter_Check(PyObject *);
602602
#endif
603603

604604
/* Takes an iterator object and calls its tp_iternext slot,

Include/pyerrors.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
142142

143143
#ifndef Py_LIMITED_API
144144
#define PyExceptionClass_Name(x) \
145-
((char *)(((PyTypeObject*)(x))->tp_name))
145+
((char *)(((PyTypeObject *)(x))->tp_name))
146146
#else
147-
PyAPI_FUNC(char *) PyExceptionClass_Name(PyObject*);
147+
PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *);
148148
#endif
149149

150150
#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Seven macro incompatibilities with the Limited API were fixed, and the
22
macros PyIter_Check, PyIndex_Check and PyExceptionClass_Name were added as
3-
functions. A script for automatic macro checks was added.
3+
functions. The return type of PyExceptionClass_Name is "const char \*".
4+
A script for automatic macro checks was added.

Objects/abstract.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@ PyNumber_Absolute(PyObject *o)
12451245
}
12461246

12471247
#undef PyIndex_Check
1248+
12481249
int
12491250
PyIndex_Check(PyObject *obj)
12501251
{
@@ -2544,6 +2545,7 @@ PyObject_GetIter(PyObject *o)
25442545
}
25452546

25462547
#undef PyIter_Check
2548+
25472549
int PyIter_Check(PyObject *obj)
25482550
{
25492551
return obj->ob_type->tp_iternext != NULL &&

Objects/exceptions.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ PyException_SetContext(PyObject *self, PyObject *context)
343343
}
344344

345345
#undef PyExceptionClass_Name
346+
346347
char *
347348
PyExceptionClass_Name(PyObject *ob)
348349
{

0 commit comments

Comments
 (0)