fix is_wsl() on wsl2

on wsl2 the /proc/version contains no Microsoft as wsl1 do.
This commit is contained in:
Cherichy
2020-05-21 17:45:45 +08:00
committed by David Adam
parent 38a6f34dd5
commit b34d9bcc97

View File

@@ -47,7 +47,7 @@ def is_wsl():
""" Return whether we are running under the Windows Subsystem for Linux """
if "linux" in platform.system().lower() and os.access("/proc/version", os.R_OK):
with open("/proc/version", "r") as f:
if "Microsoft" in f.read():
if "microsoft" in f.read():
return True
return False