diff options
author | Will <will@mon.im> | 2021-09-03 09:59:06 +1000 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-09-03 08:39:36 -0400 |
commit | 7ac9413cd5d92c55492944447559eab8e3d8aed9 (patch) | |
tree | da096760a202bbf3509a9d5d19530bfc57eabae0 /mesonbuild/mesonlib | |
parent | 4745037f4b4575395e5487c5c2b23dbf6c225286 (diff) | |
download | meson-7ac9413cd5d92c55492944447559eab8e3d8aed9.zip meson-7ac9413cd5d92c55492944447559eab8e3d8aed9.tar.gz meson-7ac9413cd5d92c55492944447559eab8e3d8aed9.tar.bz2 |
Improve WSL detection
WSL 2 removes the "Microsoft" from `platform.version` but leaves it inside `platform.release`. This lets us detect both types of WSL without issue.
Diffstat (limited to 'mesonbuild/mesonlib')
-rw-r--r-- | mesonbuild/mesonlib/universal.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index e4664d5..1680541 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -636,7 +636,7 @@ def is_windows() -> bool: return platname == 'windows' def is_wsl() -> bool: - return is_linux() and 'microsoft' in platform.version().lower() + return is_linux() and 'microsoft' in platform.release().lower() def is_cygwin() -> bool: return sys.platform == 'cygwin' |