From 81a8c488f007e842e83aa16ba941877250430a15 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 15 Feb 2023 22:47:37 -0500 Subject: [PATCH] python dependency: handle broken pylong on many more versions of python This workaround was never exclusive to python2, and in fact only just got fixed in the upcoming python 3.12 release. Extend the version comparison to cover all those other cases. --- mesonbuild/dependencies/python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py index 6b68d11f4..5c04c620c 100644 --- a/mesonbuild/dependencies/python.py +++ b/mesonbuild/dependencies/python.py @@ -190,7 +190,8 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase): self.compile_args += ['-I' + path for path in inc_paths if path] # https://sourceforge.net/p/mingw-w64/mailman/message/30504611/ - if mesonlib.is_windows() and self.get_windows_python_arch() == '64' and self.major_version == 2: + # https://github.com/python/cpython/pull/100137 + if mesonlib.is_windows() and self.get_windows_python_arch() == '64' and mesonlib.version_compare(self.version, '<3.12'): self.compile_args += ['-DMS_WIN64'] if not self.clib_compiler.has_header('Python.h', '', environment, extra_args=self.compile_args):