mypy/fs,sphinx
This commit is contained in:
parent
3a8b239b9f
commit
e213285987
2 changed files with 11 additions and 6 deletions
|
@ -68,12 +68,12 @@ def read_file_text(file_path: str, charset: str = CHARSET) -> str:
|
|||
return read_file_bytes(file_path).decode(charset)
|
||||
|
||||
|
||||
def wipe(path: str) -> None:
|
||||
def wipe(path: Path) -> None:
|
||||
"""Wipe provided path, whether directory or file."""
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except NotADirectoryError:
|
||||
Path(path).unlink(missing_ok=True)
|
||||
path.unlink(missing_ok=True)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue