summaryrefslogtreecommitdiffstats
path: root/extras/autoship.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-02-16 16:12:29 +0100
committerDavid Robillard <d@drobilla.net>2020-02-16 17:15:42 +0100
commit1784a9c609dd26b2c77292c99ec0afac293f92a0 (patch)
treeec65524cdd055e28b46aeb6307aa3dae09696fcc /extras/autoship.py
parent40301bee06908acfa62110e4d4b5ce79e1af04e2 (diff)
downloadautowaf-1784a9c609dd26b2c77292c99ec0afac293f92a0.tar.gz
autowaf-1784a9c609dd26b2c77292c99ec0afac293f92a0.tar.bz2
autowaf-1784a9c609dd26b2c77292c99ec0afac293f92a0.zip
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.
Diffstat (limited to 'extras/autoship.py')
-rwxr-xr-xextras/autoship.py7
1 files changed, 1 insertions, 6 deletions
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):