From fef81e25b1efeffdfe88d240c70cb7526e8d5c41 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Wed, 11 Sep 2019 11:00:18 -0700 Subject: pq: Don't bubble up FileNotFoundException Closes: #940043 --- gbp/scripts/common/pq.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index 552602e2..1a80ec05 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -277,11 +277,14 @@ def get_maintainer_from_control(repo): control = os.path.join(repo.path, 'debian', 'control') maint_re = re.compile('Maintainer: +(?P.*[^ ]) *<(?P.*)>') - with open(control, encoding='utf-8') as f: - for line in f: - m = maint_re.match(line) - if m: - return GitModifier(m.group('name'), m.group('email')) + try: + with open(control, encoding='utf-8') as f: + for line in f: + m = maint_re.match(line) + if m: + return GitModifier(m.group('name'), m.group('email')) + except FileNotFoundError: + raise GbpError("Debian control file {} not found".format(control)) return GitModifier() -- cgit v1.2.3