Catch errors when parsing debian/changelog in parse_deb_project

authorJulien Cristau <julien.cristau@logilab.fr>
changeset68f6a41f1b78
branchdefault
phasepublic
hiddenno
parent revision#062b6590cfa3 narval: Fix default distribution for lgp build
child revision#8f203182838e Only parse one block from the debian changelog
files modified by this revision
lgp/utils.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1312203525 -7200
# Mon Aug 01 14:58:45 2011 +0200
# Node ID 68f6a41f1b7876c9fae79864964d3e558d3002c2
# Parent 062b6590cfa32e5ca7184f70daf7dbbbf6352a7c
Catch errors when parsing debian/changelog in parse_deb_project

diff --git a/lgp/utils.py b/lgp/utils.py
@@ -241,12 +241,15 @@
1      except ChangelogParseError:
2          raise LGPException("Malformed Debian changelog '%s'" % changelog)
3 
4  def _parse_deb_project(changelog='debian/changelog'):
5      clog = Changelog()
6 -    clog.parse_changelog(open(changelog))
7 -    return clog.package
8 +    try:
9 +        clog.parse_changelog(open(changelog))
10 +        return clog.package
11 +    except ChangelogParseError:
12 +        raise LGPException("Malformed Debian changelog '%s'" % changelog)
13 
14  @contextmanager
15  def tempdir(keep_tmpdir=False):
16      """create new build temporary context
17