From b20db3b8a79c3e4e3421b1882fa80964726bdb4b Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 27 May 2018 16:00:29 +0200 Subject: Simplify error exits Had missed sys.exit(msg). --- examples/find_symbol.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'examples/find_symbol.py') diff --git a/examples/find_symbol.py b/examples/find_symbol.py index b490e4d..55e6345 100644 --- a/examples/find_symbol.py +++ b/examples/find_symbol.py @@ -171,8 +171,7 @@ def nodes_referencing_sym(node, sym_name): # imported if __name__ == "__main__": if len(sys.argv) < 3: - print('Pass symbol name (without "CONFIG_" prefix) with SCRIPT_ARG=') - sys.exit(1) + sys.exit('Pass symbol name (without "CONFIG_" prefix) with SCRIPT_ARG=') sym_name = sys.argv[2] @@ -180,8 +179,7 @@ if __name__ == "__main__": nodes = nodes_referencing_sym(kconf.top_node, sym_name) if not nodes: - print("No reference to '{}' found".format(sym_name)) - sys.exit() + sys.exit("No reference to '{}' found".format(sym_name)) print("Found {} locations that reference '{}':\n".format(len(nodes), sym_name)) -- cgit v1.2.3