mirror of https://github.com/mahmoud/boltons.git
mkdir -p
This commit is contained in:
parent
ffd6abd1d2
commit
d0ffe8b407
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
import re
|
||||
import errno
|
||||
import fnmatch
|
||||
|
||||
|
||||
|
@ -26,3 +27,13 @@ def iter_find_files(directory, patterns):
|
|||
filename = os.path.join(root, basename)
|
||||
yield filename
|
||||
return
|
||||
|
||||
|
||||
def mkdir_p(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc:
|
||||
if exc.errno == errno.EEXIST and os.path.isdir(path):
|
||||
return
|
||||
raise
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue