From 62a18e32d0a329cbe065244185790c4d3550a14e Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Thu, 18 Apr 2019 14:59:51 +0100 Subject: [PATCH] Add documentation for why we're catching all exceptions We wish to distinguish between success, an abi break and a script failure, so catch all uncaught exceptions and exit explicitly with status 2 --- scripts/abi_check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/abi_check.py b/scripts/abi_check.py index e5d5c99c30..f837f7a797 100755 --- a/scripts/abi_check.py +++ b/scripts/abi_check.py @@ -393,7 +393,9 @@ def run_main(): abi_check = AbiChecker(old_version, new_version, configuration) return_code = abi_check.check_for_abi_changes() sys.exit(return_code) - except Exception: + except Exception: # pylint: disable=broad-except + # Print the backtrace and exit explicitly so as to exit with + # status 2, not 1. traceback.print_exc() sys.exit(2)