Check that /proc/version is readable before reading it in web_config.

/proc/version may be unreadable in Android.
This commit is contained in:
Lior Stern
2019-10-25 12:49:18 +03:00
committed by Fabian Homborg
parent f8ead077bf
commit 2810ba0014

View File

@@ -43,7 +43,7 @@ def isMacOS10_12_5_OrLater():
def is_wsl():
""" Return whether we are running under the Windows Subsystem for Linux """
if "linux" in platform.system().lower():
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():
return True