osclib/core: package_source_hash(): handle non-existant revision.

This commit is contained in:
Jimmy Berry 2019-03-20 17:38:19 -05:00
parent d3c0e8ba7f
commit 07ecf7b250

View File

@ -526,7 +526,8 @@ def package_source_hash(apiurl, project, package, revision=None):
url = makeurl(apiurl, ['source', project, package], query)
root = ETL.parse(http_GET(url)).getroot()
except HTTPError as e:
if e.code == 404:
if e.code == 400 or e.code == 404:
# 400: revision not found, 404: package not found.
return None
raise e