From bc6fefe3a088d4846fac484b95c8b2944ef443e9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Oct 2020 10:35:47 +0200 Subject: [PATCH] Py3: fix warning: missing field 'tp_print' initializer [-Wmissing-field-initializers] This warning is only specific to Py3.8. See https://docs.python.org/3/c-api/typeobj.html --- src/Tools/generateTemplates/templateClassPyExport.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index aaea98c771..bceef0d7be 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -366,8 +366,12 @@ PyTypeObject @self.export.Name@::Type = { #if PY_MAJOR_VERSION >= 3 ,0 /*tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x03080000 +#if PY_VERSION_HEX >= 0x03090000 ,0 /*tp_vectorcall */ +#elif PY_VERSION_HEX >= 0x03080000 + ,0 /*tp_vectorcall */ + /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */ + ,0 /*tp_print */ #endif };