File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 1313from json import load , dump
1414import os
1515import shutil
16+ import errno
1617from StringIO import StringIO
1718from warnings import warn
1819
1920from ..external import portalocker
20- from .filemanip import mkdir_p
2121
2222# Get home directory in platform-agnostic way
2323homedir = os .path .expanduser ('~' )
5656interval = 1209600
5757""" % (homedir , os .getcwd ())
5858
59+
60+ def mkdir_p (path ):
61+ try :
62+ os .makedirs (path )
63+ except OSError as exc :
64+ if exc .errno == errno .EEXIST and os .path .isdir (path ):
65+ pass
66+ else :
67+ raise
68+
69+
5970class NipypeConfig (object ):
6071 """Base nipype config class
6172 """
Original file line number Diff line number Diff line change 1313import os
1414import re
1515import shutil
16- import errno
1716
1817import numpy as np
1918
2019from ..interfaces .traits_extension import isdefined
2120from .misc import is_container
21+ from .config import mkdir_p
2222
2323from .. import logging , config
2424fmlogger = logging .getLogger ("filemanip" )
@@ -431,13 +431,3 @@ def write_rst_dict(info, prefix=''):
431431 for key , value in sorted (info .items ()):
432432 out .append (prefix + '* ' + key + ' : ' + str (value ))
433433 return '\n ' .join (out )+ '\n \n '
434-
435-
436- def mkdir_p (path ):
437- try :
438- os .makedirs (path )
439- except OSError as exc :
440- if exc .errno == errno .EEXIST and os .path .isdir (path ):
441- pass
442- else :
443- raise
You can’t perform that action at this time.
0 commit comments