Skip to content

Commit 9250036

Browse files
committed
Fix mypy type error in _add_path_with_parent function
Update the path parameter type annotation from str | None to PathLike | None to match the types passed from callers like _load_legacy_pickle and algo_from_json.
1 parent 0a0e064 commit 9250036

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/auto3dseg/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def _make_json_serializable(value: Any) -> Any:
302302
return str(value)
303303

304304

305-
def _add_path_with_parent(paths: list[str], path: str | None) -> None:
305+
def _add_path_with_parent(paths: list[str], path: PathLike | None) -> None:
306306
"""Add a path and its parent directory to the list if the path is a valid directory."""
307307
if path and os.path.isdir(str(path)):
308308
abs_path = os.path.abspath(str(path))

0 commit comments

Comments
 (0)