diff --git a/appPublic/folderUtils.py b/appPublic/folderUtils.py index 38197f5..34d10cd 100755 --- a/appPublic/folderUtils.py +++ b/appPublic/folderUtils.py @@ -142,18 +142,7 @@ def _mkdir(newdir) : - regular file in the way, raise an exception - parent directory(ies) does not exist, make them as well """ - if os.path.isdir(newdir): - pass - elif os.path.isfile(newdir): - raise OSError("a file with the same name as the desired " \ - "dir, '%s', already exists." % newdir) - else: - head, tail = os.path.split(newdir) - if head and not os.path.isdir(head): - _mkdir(head) - #print "_mkdir %s" % repr(newdir) - if tail: - os.mkdir(newdir) + return os.makedirs(newdir, exist_ok=True) def _copyfile(fp,dir) : fs = open(fp,'rb')