diff --git a/gvsbuild/utils/builder.py b/gvsbuild/utils/builder.py index 9b12340f0..3d07882a1 100644 --- a/gvsbuild/utils/builder.py +++ b/gvsbuild/utils/builder.py @@ -32,7 +32,6 @@ from typing import Optional from urllib.error import ContentTooShortError, URLError from urllib.request import urlopen -from string import ascii_uppercase from .base_expanders import dirlist2set, make_zip from .base_project import Project @@ -231,10 +230,21 @@ def __check_tools(self, opts): log.start("Checking msys tool") msys_path = opts.msys_dir if not msys_path or not Path.exists(msys_path): - # list of drive letters to check - possible_drives = ['%s:' % d for d in ascii_uppercase if os.path.exists('%s:' % d)] - possible_paths = [r"\msys64", r"\tools\msys64", r"\msys32", r"\tools\msys32"] - all_possible_paths = [Path(drive + path) for drive in possible_drives for path in possible_paths] + drive_letters = ("C:", "D:", "E:", "F:") + possible_drives = [ + drive for drive in drive_letters if os.path.exists(drive) + ] + possible_paths = [ + r"\msys64", + r"\tools\msys64", + r"\msys32", + r"\tools\msys32", + ] + all_possible_paths = [ + Path(drive + path) + for drive in possible_drives + for path in possible_paths + ] for path in all_possible_paths: if Path.exists(path):