aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-06-02 16:38:19 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-06-02 16:38:19 +0100
commit8e512c19b4caec4f08788d609f2e8314c41788b6 (patch)
treed3734d23e4b4c45205b21e63e75eee77a5d00dd1
parent93775bfbc94ffe876a29c2c6625397e65b32c099 (diff)
downloadubox-msx-lib-8e512c19b4caec4f08788d609f2e8314c41788b6.tar.gz
ubox-msx-lib-8e512c19b4caec4f08788d609f2e8314c41788b6.zip
Use a friendlier error when sdcc is not found
-rwxr-xr-xtools/mkdeps.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/mkdeps.py b/tools/mkdeps.py
index 455dd06..8881cf0 100755
--- a/tools/mkdeps.py
+++ b/tools/mkdeps.py
@@ -60,9 +60,12 @@ def main():
for d in sorted(glob.glob(os.path.join(args.dir, "*.c"))):
if args.verbose:
print("running %r" % " ".join(cmd + [d]))
- out = subprocess.run(cmd + [d], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- if out.returncode:
- sys.exit("Error: %s" % out.stderr)
+ try:
+ out = subprocess.run(cmd + [d], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ if out.returncode:
+ sys.exit("Error: %s" % out.stderr)
+ except FileNotFoundError:
+ sys.exit(f"Error: {cmd[0]} not found in the PATH")
out = out.stdout.decode("utf-8").strip("\n\r")
result.append(re.sub(FIX_RE, fix_path, out))