Avoid searching for old nightlies in missing dirs

These directories may be missing (e.g. a first time build),
so don't try to look inside them for old nightlies if so.
This commit is contained in:
Aneesh Agrawal 2017-04-27 17:30:56 -04:00
parent 7ff803e322
commit ba874d67bb

View file

@ -323,6 +323,8 @@ class MachCommands(CommandBase):
removing_anything = False
for tool in ["rust", "cargo"]:
base = path.join(self.context.sharedir, tool)
if not path.isdir(base):
continue
for name in os.listdir(base):
# We append `-alt` if LLVM assertions aren't enabled,
# so use just the commit hash itself.