Skip to content

Commit 7e66b04

Browse files
committed
take switch and loggin outside try except
1 parent 5f87526 commit 7e66b04

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

nipype/utils/filemanip.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,14 +680,14 @@ def makedirs(path, exist_ok=False):
680680
return path
681681

682682
# this odd approach deals with concurrent directory cureation
683-
try:
684-
if not os.path.exists(os.path.abspath(path)):
685-
fmlogger.debug("Creating directory %s", path)
683+
if not os.path.exists(os.path.abspath(path)):
684+
fmlogger.debug("Creating directory %s", path)
685+
try:
686686
os.makedirs(path)
687-
except OSError:
688-
fmlogger.debug("Problem creating directory %s", path)
689-
if not os.path.exists(path):
690-
raise OSError('Could not create directory %s' % path)
687+
except OSError:
688+
fmlogger.debug("Problem creating directory %s", path)
689+
if not os.path.exists(path):
690+
raise OSError('Could not create directory %s' % path)
691691
return path
692692

693693

0 commit comments

Comments
 (0)