mkdirp -> os.makedirs(..., exist_ok=True)

This commit is contained in:
Anthony Sottile
2020-01-12 11:50:40 -08:00
parent 67c2dcd90d
commit 2a9893d0f0
5 changed files with 9 additions and 21 deletions

View File

@@ -29,14 +29,6 @@ else: # pragma: no cover (<PY37)
EnvironT = Union[Dict[str, str], 'os._Environ']
def mkdirp(path: str) -> None:
try:
os.makedirs(path)
except OSError:
if not os.path.exists(path):
raise
@contextlib.contextmanager
def clean_path_on_failure(path: str) -> Generator[None, None, None]:
"""Cleans up the directory on an exceptional failure."""