Skip to content

Commit

Permalink
Linker error with Python 3.11
Browse files Browse the repository at this point in the history
Problem: Linker error with dynamic Python 3.11, because
_PyObject_TypeCheck is no longer available in Python3.11
Solution: Undefine PyObject_TypeCheck() from Python3.11 and define it
internally in Vim if Python is 3.11.0.b3 or higher.
  • Loading branch information
zdohnal committed Jun 27, 2022
1 parent 1ae8c26 commit 89cdcd5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/if_python3.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,12 @@ py3__PyObject_TypeCheck(PyObject *ob, PyTypeObject *type)
{
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
}
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
# if PY_VERSION_HEX >= 0x030b00b3
# undef PyObject_TypeCheck
# define PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
# else
# define _PyObject_TypeCheck(o,t) py3__PyObject_TypeCheck(o,t)
# endif
# endif

# ifdef MSWIN
Expand Down

0 comments on commit 89cdcd5

Please sign in to comment.