Skip to content

Commit fee511c

Browse files
zdohnalbrammool
authored andcommitted
patch 8.2.5168: cannot build with Python 3.11
Problem: Cannot build with Python 3.11. Solution: Adjust define for _PyObject_TypeCheck. (Zdenek Dohnal, closes #10627)
1 parent 1ae8c26 commit fee511c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/if_python3.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,12 @@ py3__PyObject_TypeCheck(PyObject *ob, PyTypeObject *type)
692692
{
693693
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
694694
}
695-
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
695+
# if PY_VERSION_HEX >= 0x030b00b3
696+
# undef PyObject_TypeCheck
697+
# define PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
698+
# else
699+
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
700+
# endif
696701
# endif
697702

698703
# ifdef MSWIN

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
5168,
738740
/**/
739741
5167,
740742
/**/

0 commit comments

Comments
 (0)