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
|
||||
"""
|
||||
try:
|
||||
shutil.rmtree(path)
|
||||
except NotADirectoryError:
|
||||
path.unlink(missing_ok=True)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except IsADirectoryError:
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def write(file_path: Path, text: str, charset: str = CHARSET) -> None:
|
||||
|
|
Loading…
Reference in a new issue