Do not make dir if it exists

This commit is contained in:
Laurent Bachelier 2013-04-16 11:28:34 +02:00 committed by Romain Bignon
commit 46462995b9

View file

@ -42,7 +42,8 @@ class BackendsConfig(object):
try:
mode = os.stat(confpath).st_mode
except OSError:
os.makedirs(os.path.dirname(confpath))
if not os.path.isdir(os.path.dirname(confpath)):
os.makedirs(os.path.dirname(confpath))
if sys.platform == 'win32':
fptr = open(confpath, 'w')
fptr.close()