Commit 65b82f69 by Brian Coca

avoid failing when mode is none

parent 5622fc23
...@@ -41,7 +41,10 @@ def makedirs_safe(path, mode=None): ...@@ -41,7 +41,10 @@ def makedirs_safe(path, mode=None):
'''Safe way to create dirs in muliprocess/thread environments''' '''Safe way to create dirs in muliprocess/thread environments'''
if not os.path.exists(path): if not os.path.exists(path):
try: try:
os.makedirs(path, mode) if mode:
os.makedirs(path, mode)
else:
os.makedirs(path)
except OSError, e: except OSError, e:
if e.errno != EEXIST: if e.errno != EEXIST:
raise raise
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment