summaryrefslogtreecommitdiff
path: root/src/leap/util/fileutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/util/fileutil.py')
-rw-r--r--src/leap/util/fileutil.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/util/fileutil.py b/src/leap/util/fileutil.py
index 86a44a89..bb2c243b 100644
--- a/src/leap/util/fileutil.py
+++ b/src/leap/util/fileutil.py
@@ -1,3 +1,4 @@
+import errno
from itertools import chain
import os
import platform
@@ -71,3 +72,16 @@ def which(program):
# sorry bro.
return None
+
+
+def mkdir_p(path):
+ """
+ implements mkdir -p functionality
+ """
+ try:
+ os.makedirs(path)
+ except OSError as exc:
+ if exc.errno == errno.EEXIST:
+ pass
+ else:
+ raise