From 7a38957d6c4346d646c844eef6d318ee4a91db35 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 16 Aug 2018 10:57:27 +0100 Subject: cascache: use errno module os.errno does no longer work with Python 3.7 Closes #577. --- buildstream/_artifactcache/cascache.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 00d09773c..074899d81 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -25,6 +25,7 @@ import signal import stat import tempfile import uuid +import errno from urllib.parse import urlparse import grpc @@ -82,7 +83,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 @@ -100,7 +102,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 -- cgit v1.2.1