diff --git a/boltons/osutils.py b/boltons/osutils.py index 4c1f6c6..1e2520b 100644 --- a/boltons/osutils.py +++ b/boltons/osutils.py @@ -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