aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2019-09-11 11:00:18 -0700
committerGuido Günther <agx@sigxcpu.org>2019-09-11 11:00:18 -0700
commitfef81e25b1efeffdfe88d240c70cb7526e8d5c41 (patch)
tree19f57194674b9339023adcec9a5441e986de0f2a
parent1ab6cf44e6c412ad0e309283ce375f3c9b8bdb57 (diff)
pq: Don't bubble up FileNotFoundException
Closes: #940043
-rw-r--r--gbp/scripts/common/pq.py13
1 files 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<name>.*[^ ]) *<(?P<email>.*)>')
- 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()