From 0710ad18d919ba38d00aa5f68444e2fcb47a45ac Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 30 Aug 2020 17:53:41 +0200 Subject: Be stricter when detecting Windows/Cygwin This removes the check for "mingw" for platform.system(). The only case I know where "mingw" is return is if using a msys Python under a msys2 mingw environment. This combination is not really supported by meson and will result in weird errors, so remove the check. The second change is checking sys.platform for cygwin instead of platform.system(). The former is document to return "cygwin", while the latter is not and just returns uname(). While under Cygwin it uname() always starts with "cygwin" it's not hardcoded in MSYS2 and starts with the environment name. Using sys.platform is safer here. Fixes #7552 --- mesonbuild/mtest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mesonbuild/mtest.py') diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index d7fe54a..de82234 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -58,11 +58,10 @@ GNU_ERROR_RETURNCODE = 99 def is_windows() -> bool: platname = platform.system().lower() - return platname == 'windows' or 'mingw' in platname + return platname == 'windows' def is_cygwin() -> bool: - platname = platform.system().lower() - return 'cygwin' in platname + return sys.platform == 'cygwin' def determine_worker_count() -> int: varname = 'MESON_TESTTHREADS' -- cgit v1.1