From 4bf7b16358d96378c915ad9e15a1b51969d475d2 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 26 Apr 2021 15:36:30 +0800 Subject: [PATCH] check_readme_links: remove throwing of exception before exit Reraising the exception before exiting was intended to help troubleshoot, but turned out to be more confusing than helpful as it might look like the script was failing --- tools/ci/check_readme_links.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/ci/check_readme_links.py b/tools/ci/check_readme_links.py index 8955db4be0..1fa9278121 100755 --- a/tools/ci/check_readme_links.py +++ b/tools/ci/check_readme_links.py @@ -22,6 +22,7 @@ import concurrent.futures import os import os.path import re +import sys import urllib.error import urllib.request from collections import defaultdict, namedtuple @@ -148,8 +149,8 @@ def check_readme_links(args): print('Found {} errors:'.format(len(errors))) for e in errors: print(e) - if errors: - raise e + + return 1 if len(errors) > 0 else 0 if __name__ == '__main__': @@ -158,4 +159,4 @@ if __name__ == '__main__': parser.add_argument('--skip-weburl', '-w', action='store_true', help='Skip checking of web URLs, only check links to local files') args = parser.parse_args() - check_readme_links(args) + sys.exit(check_readme_links(args))