From 1784a9c609dd26b2c77292c99ec0afac293f92a0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 16 Feb 2020 16:12:29 +0100 Subject: Use exceptions on error instead of printing and sys.exit Makes things easier to figure out when using this code as a module, though it makes the console experience the usual Python nightmare. --- extras/autoship.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'extras/autoship.py') diff --git a/extras/autoship.py b/extras/autoship.py index dddb062..6028149 100755 --- a/extras/autoship.py +++ b/extras/autoship.py @@ -12,14 +12,9 @@ def warn(msg): sys.stderr.write("warning: %s\n" % msg) -def error_exit(msg): - sys.stderr.write("error: %s\n" % msg) - sys.exit(1) - - def ensure(condition, message): if not condition: - error_exit(message) + raise Exception(message) def get_project_info(top=None): -- cgit v1.2.1