Skip to content

Commit 4296797

Browse files
committed
bug fix
1 parent 661d54d commit 4296797

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autointent/_dump_tools/unit_dumpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class SimpleAttributesDumper(BaseObjectDumper[dict[str, ModuleSimpleAttributes]]
5050

5151
@staticmethod
5252
def dump(obj: dict[str, ModuleSimpleAttributes], path: Path, exists_ok: bool) -> None: # noqa: ARG004
53+
path.parent.mkdir(parents=True, exist_ok=True)
5354
with path.open("w", encoding="utf-8") as file:
5455
json.dump(obj, file, ensure_ascii=False, indent=4)
5556

@@ -120,8 +121,8 @@ class EstimatorDumper(BaseObjectDumper[BaseEstimator]):
120121
dir_or_file_name = "estimators"
121122

122123
@staticmethod
123-
def dump(obj: BaseEstimator, path: Path, exists_ok: bool) -> None:
124-
path.parent.mkdir(parents=True, exist_ok=exists_ok)
124+
def dump(obj: BaseEstimator, path: Path, exists_ok: bool) -> None: # noqa: ARG004
125+
path.parent.mkdir(parents=True, exist_ok=True)
125126
joblib.dump(obj, path)
126127

127128
@staticmethod

0 commit comments

Comments
 (0)