mkdir_p.py 218 B

123456789101112
  1. import os
  2. import errno
  3. def mkdir_p(path):
  4. try:
  5. os.makedirs(path)
  6. except OSError as exc:
  7. if exc.errno == errno.EEXIST and os.path.isdir(path):
  8. pass
  9. else:
  10. raise