diff options
author | Yee Cheng Chin <ychin.git@gmail.com> | 2024-09-09 19:46:17 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-09-09 19:46:17 +0200 |
commit | 97a5be46879ab2b24bb9b485966be031865e1191 (patch) | |
tree | 407a0bcd7c06cba09dc1768f2f6971e96506fd3b | |
parent | 701c863e68fa24847100beef3c9008024615a081 (diff) |
patch 9.1.0723: if_python: dynamic linking fails with python3 >= 3.13v9.1.0723
Problem: if_python: dynamic linking fails with python3 >= 3.13
when using non-stable ABI (zdohnal)
Solution: do not try to import the privat python symbol
_PyObject_NextNotImplemented
(Yee Cheng Chin)
Vim is importing a private Python symbol `_PyObject_NextNotImplemented`
because it used to be required as part of the `PyIter_Check()` macro in
an abstraction breaking way. Python eventually fixed the issue and in
3.13 it removed the private symbol export, which broke Vim. Simply
remove importing this private symbol in newer Python versions as it's no
longer needed for PyIter_Check to work.
fixes: #15457
closes: #15649
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | src/if_python3.c | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/if_python3.c b/src/if_python3.c index ac817bdce4..fd117f0a71 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -267,7 +267,8 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll # define _Py_NoneStruct (*py3__Py_NoneStruct) # define _Py_FalseStruct (*py3__Py_FalseStruct) # define _Py_TrueStruct (*py3__Py_TrueStruct) -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 +// Private symbol that used to be required as part of PyIter_Check. # define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented) # endif # define PyModule_AddObject py3_PyModule_AddObject @@ -482,7 +483,7 @@ static void (*py3_PyErr_Clear)(void); static PyObject* (*py3_PyErr_Format)(PyObject *, const char *, ...); static void (*py3_PyErr_PrintEx)(int); static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *); -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 static iternextfunc py3__PyObject_NextNotImplemented; # endif static PyObject* py3__Py_NoneStruct; @@ -679,7 +680,7 @@ static struct {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread}, {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&py3_PyArg_Parse}, {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized}, -# ifndef USE_LIMITED_API +# if !defined(USE_LIMITED_API) && PY_VERSION_HEX < 0x030D0000 {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented}, # endif {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct}, diff --git a/src/version.c b/src/version.c index 4460bb16ec..db611c9695 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 723, +/**/ 722, /**/ 721, |