diff options
author | Chris Lamb <lamby@debian.org> | 2016-07-19 06:47:26 +0000 |
---|---|---|
committer | Chris Lamb <lamby@debian.org> | 2016-07-19 06:47:26 +0000 |
commit | 082eb73d13cdd2b3ec5b17a241ac9eb9eb14e41f (patch) | |
tree | 6fbab6aed7f5f7e377bb04919d56b9982983e150 /bin/contact-maintainers | |
parent | 1fd9d1b053aac4f45e4a85392505062568aaf401 (diff) |
bin/contact-maintainers: Nicer error message if you mistype package name
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@43274 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/contact-maintainers')
-rwxr-xr-x | bin/contact-maintainers | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/contact-maintainers b/bin/contact-maintainers index 7940c5a512..560e727139 100755 --- a/bin/contact-maintainers +++ b/bin/contact-maintainers @@ -6,6 +6,7 @@ import pwd import subprocess import sys import tempfile +import urllib2 import warnings from jinja2 import Template @@ -39,8 +40,13 @@ else: maint = [] graph = rdflib.Graph() - graph.parse('https://packages.qa.debian.org/{}/{}.rdf' - .format(re.match('((?:lib)?.)', pkg).group(1), pkg)) + try: + graph.parse('https://packages.qa.debian.org/{}/{}.rdf' + .format(re.match('((?:lib)?.)', pkg).group(1), pkg)) + except urllib2.HTTPError, exc: + if exc.code == 404: + raise ValueError("unknown package '{}'".format(pkg)) + raise for contrib in graph[project : has_contributor]: names = [n for n in graph[contrib : is_named]] addresses = [urllib.unquote(m.group(1)) for m in |