summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Gomes <tiago.gomes@codethink.co.uk>2018-08-16 10:57:27 +0100
committerTiago Gomes <tiago.avv@gmail.com>2018-08-16 15:00:34 +0000
commitf15ff4562d5ce3fbebdedde5d28e0436d53a6887 (patch)
tree8a00aad528ce53f93adf23470241002caf86b593
parent43f4ffba5e542fc16c97eb2eb4133daed1b5fd84 (diff)
downloadbuildstream-tiagogomes/issue-577-backport.tar.gz
cascache: use errno moduletiagogomes/issue-577-backport
os.errno does no longer work with Python 3.7 Closes #577.
-rw-r--r--buildstream/_artifactcache/cascache.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 4fea98626..5c56e93b7 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -24,6 +24,7 @@ import os
import signal
import stat
import tempfile
+import errno
from urllib.parse import urlparse
import grpc
@@ -81,7 +82,8 @@ class CASCache(ArtifactCache):
tree = self.resolve_ref(ref, update_mtime=True)
- dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, tree.hash)
+ dest = os.path.join(self.extractdir, element._get_project().name,
+ element.normal_name, tree.hash)
if os.path.isdir(dest):
# artifact has already been extracted
return dest
@@ -99,7 +101,7 @@ class CASCache(ArtifactCache):
#
# If rename fails with these errors, another process beat
# us to it so just ignore.
- if e.errno not in [os.errno.ENOTEMPTY, os.errno.EEXIST]:
+ if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]:
raise ArtifactError("Failed to extract artifact for ref '{}': {}"
.format(ref, e)) from e