Changeset 595915c for asadb/util/misc.py


Ignore:
Timestamp:
May 23, 2010, 6:37:11 AM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, fysm-4-1, space-access, stable, stage, test-hooks
Children:
f3dcf5a
Parents:
25aaeb6
git-author:
Alex Dehnert <adehnert@…> (05/23/10 06:37:11)
git-committer:
Alex Dehnert <adehnert@…> (05/23/10 06:37:11)
Message:

Add a mkdir -p equivalent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/util/misc.py

    r1f94b84 r595915c  
    11import traceback
     2import os, errno
    23
    34def log_and_ignore_failures(logfile):
     
    1213        return new_f
    1314    return decorator
     15
     16def mkdir_p(path):
     17    try:
     18        os.makedirs(path)
     19    except OSError as exc: # Python >2.5
     20        if exc.errno == errno.EEXIST:
     21            pass
     22        else: raise
Note: See TracChangeset for help on using the changeset viewer.