patch 9.1.0521: if_py: _PyObject_CallFunction_SizeT is dropped in Python 3.13

Commit: 
https://github.com/vim/vim/commit/4179f193ccc26e95fec66273ffa036be1ab85e0a
Author: Yaakov Selkowitz <yselk...@redhat.com>
Date:   Thu Jul 4 16:36:05 2024 +0200

    patch 9.1.0521: if_py: _PyObject_CallFunction_SizeT is dropped in Python 
3.13
    
    Problem:  if_py: _PyObject_CallFunction_SizeT is dropped in Python 3.13
    Solution: define PyObject_CallFunction for Python >= 3.13
              (Yaakov Selkowitz)
    
    references: python/cpython#105051
    
    closes: #15088
    
    Signed-off-by: Yaakov Selkowitz <yselk...@redhat.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/if_python3.c b/src/if_python3.c
index c135e7e6f..96c949771 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -232,7 +232,11 @@ static HINSTANCE hinstPy3 = 0; // Instance of python.dll
 # define PyObject_HasAttrString py3_PyObject_HasAttrString
 # define PyObject_SetAttrString py3_PyObject_SetAttrString
 # define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs
-# define _PyObject_CallFunction_SizeT py3__PyObject_CallFunction_SizeT
+# if PY_VERSION_HEX >= 0x030d0000
+#  define PyObject_CallFunction py3_PyObject_CallFunction
+# else
+#  define _PyObject_CallFunction_SizeT py3__PyObject_CallFunction_SizeT
+# endif
 # define PyObject_Call py3_PyObject_Call
 # define PyEval_GetLocals py3_PyEval_GetLocals
 # define PyEval_GetGlobals py3_PyEval_GetGlobals
@@ -398,7 +402,11 @@ static PyObject* (*py3_PyObject_GetAttrString)(PyObject *, 
const char *);
 static int (*py3_PyObject_HasAttrString)(PyObject *, const char *);
 static int (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *);
 static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...);
+# if PY_VERSION_HEX >= 0x030d0000
+static PyObject* (*py3_PyObject_CallFunction)(PyObject *, char *, ...);
+# else
 static PyObject* (*py3__PyObject_CallFunction_SizeT)(PyObject *, char *, ...);
+# endif
 static PyObject* (*py3_PyObject_Call)(PyObject *, PyObject *, PyObject *);
 static PyObject* (*py3_PyEval_GetGlobals)(void);
 static PyObject* (*py3_PyEval_GetLocals)(void);
@@ -601,7 +609,11 @@ static struct
     {"PyObject_HasAttrString", (PYTHON_PROC*)&py3_PyObject_HasAttrString},
     {"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString},
     {"PyObject_CallFunctionObjArgs", 
(PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs},
+# if PY_VERSION_HEX >= 0x030d0000
+    {"PyObject_CallFunction", (PYTHON_PROC*)&py3_PyObject_CallFunction},
+# else
     {"_PyObject_CallFunction_SizeT", 
(PYTHON_PROC*)&py3__PyObject_CallFunction_SizeT},
+# endif
     {"PyObject_Call", (PYTHON_PROC*)&py3_PyObject_Call},
     {"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals},
     {"PyEval_GetLocals", (PYTHON_PROC*)&py3_PyEval_GetLocals},
diff --git a/src/version.c b/src/version.c
index ec993ab6b..7e4b647a7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    521,
 /**/
     520,
 /**/

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sPNwJ-002RUu-2x%40256bit.org.

Raspunde prin e-mail lui