mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-16 05:53:30 -06:00
mkdirp -> os.makedirs(..., exist_ok=True)
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user