summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-22 17:27:38 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-22 17:27:38 +0900
commitdd67fecd178082ec9b52820bb86a3b58d8cec001 (patch)
treec29b343c82829b11276af757d5640e103fb6175a
parent54ba73241bb812a3b69e3da5cb8ed8c6d2cfbb38 (diff)
downloadbuildstream-dd67fecd178082ec9b52820bb86a3b58d8cec001.tar.gz
_artifactcache/ostreecache.py: Turn an ArtifactError() into an assert statement
This should be an assertion as it will trigger a proper BUG message with a usable stack trace. An incident of this ArtifactError() was reported in issue #305.
-rw-r--r--buildstream/_artifactcache/ostreecache.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/ostreecache.py b/buildstream/_artifactcache/ostreecache.py
index d9b0295ea..fa44beab8 100644
--- a/buildstream/_artifactcache/ostreecache.py
+++ b/buildstream/_artifactcache/ostreecache.py
@@ -44,8 +44,7 @@ def buildref(element, key):
for x in element.normal_name
])
- if key is None:
- raise ArtifactError('Cache key missing')
+ assert key is not None
# assume project and element names are not allowed to contain slashes
return '{0}/{1}/{2}'.format(project.name, element_name, key)