Skip to content

Commit

Permalink
Add WSL debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dramelac committed May 22, 2024
1 parent bc20e98 commit a717a74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions exegol/utils/GuiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,16 @@ def __wsl_available(cls) -> bool:
if EnvInfo.isWindowsHost():
wsl = shutil.which("wsl.exe")
if not wsl:
logger.debug("wsl.exe not found on the local system.")
return False
ret = subprocess.Popen(["wsl.exe", "--status"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
ret.wait()
if ret.returncode == 0:
return True
else:
logger.debug(f"wsl.exe --status return code {ret.returncode}")
logger.debug(str(ret.stdout))
logger.debug(str(ret.stderr))
logger.debug("WSL status command failed.. Trying a fallback check method.")
return cls.__wsl_test("/etc/os-release", name=None) or cls.__wsl_test("/etc/os-release")

Expand Down

0 comments on commit a717a74

Please sign in to comment.