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,6 +42,7 @@ class BackendsConfig(object):
try: try:
mode = os.stat(confpath).st_mode mode = os.stat(confpath).st_mode
except OSError: except OSError:
if not os.path.isdir(os.path.dirname(confpath)):
os.makedirs(os.path.dirname(confpath)) os.makedirs(os.path.dirname(confpath))
if sys.platform == 'win32': if sys.platform == 'win32':
fptr = open(confpath, 'w') fptr = open(confpath, 'w')