Bug 1325481 - Update clang-format fetch/locate codepath to gracefully fail. r?sylvestre
The checking on the return of value of fetch/locate is not working as intended.
The code should be early returning, but the return value of fetch/locate is 1 in
failure cases, which will not trigger the early return. The return value has
been altered to None, which will trigger the early return.
MozReview-Commit-ID: FDCW6rbZI6T
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.py
@@ -294,17 +294,17 @@ class FormatProvider(MachCommandBase):
}
target = os.path.join(self._mach_context.state_dir, os.path.basename(root))
if not os.path.exists(target):
tooltool_url = "https://api.pub.build.mozilla.org/tooltool/sha512/"
if self.prompt and raw_input("Download clang-format executables from {0} (yN)? ".format(tooltool_url)).lower() != 'y': # noqa: E501,F821
print("Download aborted.")
- return 1
+ return None
self.prompt = False
plat = platform.system()
if python_script:
# We want to download the python script (clang-format-diff)
dl = bin_sha["python_script"]
else:
dl = bin_sha[plat]
u = tooltool_url + dl