diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-06-06 16:25:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 16:25:17 -0400 |
commit | d9d11b39caf3ec46fbdff2b3afc657cab8a26333 (patch) | |
tree | 3bf80c6df46e46db4cbe5a2c6b248994956524c0 /python/servo/bootstrap_commands.py | |
parent | b2354c6d24e1c0fcdc9d09fc6f1885f4eebb1572 (diff) | |
parent | d53e06d1f4f82181a405277db239135140f443bf (diff) | |
download | servo-d9d11b39caf3ec46fbdff2b3afc657cab8a26333.tar.gz servo-d9d11b39caf3ec46fbdff2b3afc657cab8a26333.zip |
Auto merge of #20789 - Eijebong:fix-clean-cache, r=jdm
Don't try to list files in directories that don't exist
Fixes #20784
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20789)
<!-- Reviewable:end -->
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 18653c9d4da..b422a553003 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -234,8 +234,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]), "") |