patch 9.1.1472: if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed

Commit: 
https://github.com/vim/vim/commit/c50f4d07c4424019a8f1e5a0b20bb1c29605a361
Author: Zdenek Dohnal <zdoh...@redhat.com>
Date:   Thu Jun 19 19:35:32 2025 +0200

    patch 9.1.1472: if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed
    
    Problem:  if_python: PySequence_Fast_{GET_SIZE,GET_ITEM} removed with
              python3.14 in stable ABI
    Solution: use PySequence_{Size,GetItem} instead (Zdenek Dohnal)
    
    Python 3.14 removed those two functions from stable API because of
    reasoning these function shouldn't be part of stable API at the first
    place.
    
    Moving to PySequence_GetSize and PySequence_GetItem fixes the build
    failure when Vim is built with dynamic Python and stable API for Python
    3.8.
    
    closes: #17575
    
    Signed-off-by: Zdenek Dohnal <zdoh...@redhat.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/if_py_both.h b/src/if_py_both.h
index ed66254ff..7fc055db5 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -2409,18 +2409,18 @@ DictionaryUpdate(DictionaryObject *self, PyObject 
*args, PyObject *kwargs)
 
                Py_DECREF(item);
 
-               if (PySequence_Fast_GET_SIZE(fast) != 2)
+               if (PySequence_Size(fast) != 2)
                {
                    Py_DECREF(iterator);
                    Py_DECREF(fast);
                    PyErr_FORMAT(PyExc_ValueError,
                            N_("expected sequence element of size 2, "
                            "but got sequence of size %d"),
-                           (int) PySequence_Fast_GET_SIZE(fast));
+                           (int) PySequence_Size(fast));
                    return NULL;
                }
 
-               keyObject = PySequence_Fast_GET_ITEM(fast, 0);
+               keyObject = PySequence_GetItem(fast, 0);
 
                if (!(key = StringToChars(keyObject, &todecref)))
                {
@@ -2442,7 +2442,7 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, 
PyObject *kwargs)
                }
                di->di_tv.v_type = VAR_UNKNOWN;
 
-               valObject = PySequence_Fast_GET_ITEM(fast, 1);
+               valObject = PySequence_GetItem(fast, 1);
 
                if (ConvertFromPyObject(valObject, &di->di_tv) == -1)
                {
diff --git a/src/version.c b/src/version.c
index 52fdfc361..e8673ed06 100644
--- a/src/version.c
+++ b/src/version.c
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1472,
 /**/
     1471,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uSJK0-008Oq1-Cu%40256bit.org.

Raspunde prin e-mail lui