mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Rewrite guarantee_existence using Path
This commit is contained in:
parent
53234bfa65
commit
7f9a2cf487
1 changed files with 4 additions and 4 deletions
|
@ -25,10 +25,10 @@ def add_extension_if_not_present(file_name: str, extension: str) -> str:
|
||||||
return file_name
|
return file_name
|
||||||
|
|
||||||
|
|
||||||
def guarantee_existence(path: str) -> str:
|
def guarantee_existence(path: str | Path) -> Path:
|
||||||
if not os.path.exists(path):
|
path = Path(path)
|
||||||
os.makedirs(path)
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
return os.path.abspath(path)
|
return path.absolute()
|
||||||
|
|
||||||
|
|
||||||
def find_file(
|
def find_file(
|
||||||
|
|
Loading…
Add table
Reference in a new issue