We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3abf131 commit 4fa1c2bCopy full SHA for 4fa1c2b
nipype/pipeline/engine/utils.py
@@ -1056,9 +1056,15 @@ def make_output_dir(outdir):
1056
outdir : output directory to create
1057
1058
"""
1059
- if not os.path.exists(os.path.abspath(outdir)):
1060
- logger.debug("Creating %s" % outdir)
1061
- os.makedirs(outdir)
+ # this odd approach deals with concurrent directory cureation
+ try:
+ if not os.path.exists(os.path.abspath(outdir)):
1062
+ logger.debug("Creating %s" % outdir)
1063
+ os.makedirs(outdir)
1064
+ except OSError:
1065
+ logger.debug("Problem creating %s" % outdir)
1066
+ if not os.path.exists(outdir):
1067
+ raise OSError('Could not create %s'%outdir)
1068
return outdir
1069
1070
0 commit comments