in scripts/microupload.py [0:0]
def make_dirs(files: Files, path: str,
created_cache: Set[str] = None) -> None:
"""Make all the directories the specified relative path consists of."""
if path == '.':
return
if created_cache is None:
created_cache = set()
parent = os.path.dirname(path)
if parent and parent not in created_cache:
make_dirs(files, parent, created_cache)
with suppress(DirectoryExistsError):
posix_path = path.replace(os.path.sep, '/')
files.mkdir(posix_path)
created_cache.add(path)