summaryrefslogtreecommitdiff
path: root/morphlib/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/util.py')
-rw-r--r--morphlib/util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/morphlib/util.py b/morphlib/util.py
index 94b0f4c4..b76029df 100644
--- a/morphlib/util.py
+++ b/morphlib/util.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2011-2015 Codethink Limited
+# Copyright (C) 2011-2016 Codethink Limited
# Copyright © 2015 Richard Ipsum
#
# This program is free software; you can redistribute it and/or modify
@@ -15,6 +15,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
import contextlib
+import errno
import itertools
import os
import pipes
@@ -136,7 +137,11 @@ def new_artifact_caches(settings): # pragma: no cover
cachedir = create_cachedir(settings)
artifact_cachedir = os.path.join(cachedir, 'artifacts')
if not os.path.exists(artifact_cachedir):
- os.mkdir(artifact_cachedir)
+ try:
+ os.mkdir(artifact_cachedir)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise
lac = morphlib.localartifactcache.LocalArtifactCache(
fs.osfs.OSFS(artifact_cachedir))