parent
0ae7d01a1e
commit
27329865ee
1 changed files with 2 additions and 4 deletions
|
@ -139,11 +139,9 @@ def wipe(path: Path) -> None:
|
||||||
:type path: Path
|
:type path: Path
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(path)
|
|
||||||
except NotADirectoryError:
|
|
||||||
path.unlink(missing_ok=True)
|
path.unlink(missing_ok=True)
|
||||||
except FileNotFoundError:
|
except IsADirectoryError:
|
||||||
pass
|
shutil.rmtree(path)
|
||||||
|
|
||||||
|
|
||||||
def write(file_path: Path, text: str, charset: str = CHARSET) -> None:
|
def write(file_path: Path, text: str, charset: str = CHARSET) -> None:
|
||||||
|
|
Loading…
Reference in a new issue