From 54fe7d25ba0f434987d92884e92c7825f9189abd Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 6 Oct 2016 16:10:17 +0300 Subject: Better --- mowgli.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mowgli.py b/mowgli.py index 961871c..b1b2fe6 100755 --- a/mowgli.py +++ b/mowgli.py @@ -129,11 +129,12 @@ if __name__ == '__main__': print("* Checking for updates...") - try: - if os.path.exists(sys.argv[2]): - updates = check(sys.argv[2]) - except IndexError as e: - pass + if len(sys.argv) > 2: + if not os.path.exists(sys.argv[2]): + raise Exception('Invalid MAU pref file %s' % sys.argv[2]) + updates = check(sys.argv[2]) + else: + updates = check() updates = [u for u in updates if u['needs_update']] -- cgit v1.2.3