From b21275ee9c59a9f9d184b4f1f4cb7421b04e0f1c Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 17 Feb 2016 08:00:38 +0100 Subject: [PATCH] handle exception with non-existing addon directory --- util/make_credits.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/util/make_credits.py b/util/make_credits.py index 404b059133..eacb8707f4 100755 --- a/util/make_credits.py +++ b/util/make_credits.py @@ -46,17 +46,20 @@ for i in c: n1 = len(contributors) print(' > found %d contributors' % n1) # get the contributors to the addons -os.chdir(path+'/addon') -# get the contributors -print('> getting contributors to the addons') -p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) -c = iter(p.stdout.readline, b'') -for i in c: - name = i.decode().split('\t')[1].split('\n')[0] - if not name in contributors and name not in dontinclude: - contributors.append(name) +try: + os.chdir(path+'/addon') + # get the contributors + print('> getting contributors to the addons') + p = subprocess.Popen(['git', 'shortlog', '--no-merges', '-s'], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + c = iter(p.stdout.readline, b'') + for i in c: + name = i.decode().split('\t')[1].split('\n')[0] + if not name in contributors and name not in dontinclude: + contributors.append(name) +except FileNotFoundError: + print(' > no addon directory found ( THE LIST OF CONTRIBUTORS WILL BE INCOMPLETE )') n2 = len(contributors) print(' > found %d new contributors' % (n2-n1)) print('> total of %d contributors to the repositories of friendica' % n2) -- 2.39.5