From eaa16914d1686002d33cb3f61875832977146805 Mon Sep 17 00:00:00 2001 From: Alexander Shadchin Date: Sun, 5 Jan 2020 03:32:10 +0300 Subject: [PATCH] Adding tp_vectorcall field to PyTypeObject for Python version 3.8 --- Lib/python/builtin.swg | 6 ++++++ Lib/python/pyinit.swg | 3 +++ Lib/python/pyrun.swg | 6 ++++++ Source/Modules/python.cxx | 3 +++ 4 files changed, 18 insertions(+) diff --git a/Lib/python/builtin.swg b/Lib/python/builtin.swg index 28051e67b..dbaf20d76 100644 --- a/Lib/python/builtin.swg +++ b/Lib/python/builtin.swg @@ -256,6 +256,9 @@ SwigPyStaticVar_Type(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -334,6 +337,9 @@ SwigPyObjectType(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg index dfbf40b34..129e38480 100644 --- a/Lib/python/pyinit.swg +++ b/Lib/python/pyinit.swg @@ -186,6 +186,9 @@ swig_varlink_type(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg index 82859b887..5dec384d3 100644 --- a/Lib/python/pyrun.swg +++ b/Lib/python/pyrun.swg @@ -696,6 +696,9 @@ SwigPyObject_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ @@ -857,6 +860,9 @@ SwigPyPacked_TypeOnce(void) { #if PY_VERSION_HEX >= 0x03040000 0, /* tp_finalize */ #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif #ifdef COUNT_ALLOCS 0, /* tp_allocs */ 0, /* tp_frees */ diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 4792090ea..bc7119614 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -4134,6 +4134,9 @@ public: Printv(f, "#if PY_VERSION_HEX >= 0x03040000\n", NIL); printSlot(f, getSlot(n, "feature:python:tp_finalize"), "tp_finalize", "destructor"); Printv(f, "#endif\n", NIL); + Printv(f, "#if PY_VERSION_HEX >= 0x03080000\n", NIL); + printSlot(f, getSlot(n, "feature:python:tp_vectorcall"), "tp_vectorcall", "vectorcallfunc"); + Printv(f, "#endif\n", NIL); Printv(f, "#ifdef COUNT_ALLOCS\n", NIL); printSlot(f, getSlot(n, "feature:python:tp_allocs"), "tp_allocs", "Py_ssize_t"); printSlot(f, getSlot(n, "feature:python:tp_frees"), "tp_frees", "Py_ssize_t");