From a0a6fc312ee6d1315e2ec1dc3def9ac04fe52169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20Sz=C5=B1cs?= Date: Mon, 3 Jun 2019 20:39:50 +0200 Subject: [PATCH] try catch StopIteration [skip ci] --- dev/tasks/crossbow.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dev/tasks/crossbow.py b/dev/tasks/crossbow.py index b2f6a1528bfe1..47f4b08915c45 100755 --- a/dev/tasks/crossbow.py +++ b/dev/tasks/crossbow.py @@ -236,13 +236,17 @@ def remote_url(self): @property def user_name(self): - name = os.environ.get('GIT_COMMITTER_NAME', 'unkown') - return next(self.repo.config.get_multivar('user.name') or [name]) + try: + return next(self.repo.config.get_multivar('user.name')) + except StopIteration: + return os.environ.get('GIT_COMMITTER_NAME', 'unkown') @property def user_email(self): - email = os.environ.get('GIT_COMMITTER_EMAIL', 'unkown') - return next(self.repo.config.get_multivar('user.email') or [email]) + try: + return next(self.repo.config.get_multivar('user.email')) + except StopIteration: + return os.environ.get('GIT_COMMITTER_EMAIL', 'unkown') @property def signature(self):