fix find_chrome_executable() on x86 Windows

This commit is contained in:
sebdelsol 2022-03-18 16:11:55 +01:00
parent 0bf986ee8b
commit 843173827a
1 changed files with 7 additions and 6 deletions

View File

@ -689,12 +689,13 @@ def find_chrome_executable():
for item in map(
os.environ.get, ("PROGRAMFILES", "PROGRAMFILES(X86)", "LOCALAPPDATA")
):
for subitem in (
"Google/Chrome/Application",
"Google/Chrome Beta/Application",
"Google/Chrome Canary/Application",
):
candidates.add(os.sep.join((item, subitem, "chrome.exe")))
if item is not None:
for subitem in (
"Google/Chrome/Application",
"Google/Chrome Beta/Application",
"Google/Chrome Canary/Application",
):
candidates.add(os.sep.join((item, subitem, "chrome.exe")))
for candidate in candidates:
if os.path.exists(candidate) and os.access(candidate, os.X_OK):
return os.path.normpath(candidate)