diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2018-05-15 20:14:52 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2018-05-15 20:14:52 +0200 |
commit | d53e06d1f4f82181a405277db239135140f443bf (patch) | |
tree | c5c125b50b33de81f2b56ca53e3ce4092210ae25 /python/servo/bootstrap_commands.py | |
parent | 1d8283e01059710737f55531e777a4f19adb6f9e (diff) | |
download | servo-d53e06d1f4f82181a405277db239135140f443bf.tar.gz servo-d53e06d1f4f82181a405277db239135140f443bf.zip |
Don't try to list files in directories that don't exist
Fixes #20784
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 1d103fe5aca..f732b97c59b 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -237,8 +237,14 @@ class MachCommands(CommandBase): git_dir = path.join(cargo_dir, "git") git_db_dir = path.join(git_dir, "db") git_checkout_dir = path.join(git_dir, "checkouts") - git_db_list = filter(lambda f: not f.startswith('.'), os.listdir(git_db_dir)) - git_checkout_list = os.listdir(git_checkout_dir) + if os.path.isdir(git_db_dir): + git_db_list = filter(lambda f: not f.startswith('.'), os.listdir(git_db_dir)) + else: + git_db_list = [] + if os.path.isdir(git_checkout_dir): + git_checkout_list = os.listdir(git_checkout_dir) + else: + git_checkout_list = [] for d in list(set(git_db_list + git_checkout_list)): crate_name = d.replace("-{}".format(d.split("-")[-1]), "") |