Skip to content

Commit 6b25a3b

Browse files
committed
raise FileNotFoundError in resolve_local_source
for non existing file paths
1 parent 03a0c2a commit 6b25a3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bioimageio/core/resource_io/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ def resolve_local_source(
211211
if not is_path_cwd and is_path_rp:
212212
source = path_from_root
213213

214-
if is_path_cwd or is_path_rp or isinstance(source, os.PathLike):
214+
if is_path_cwd or is_path_rp:
215215
return pathlib.Path(source)
216+
elif isinstance(source, os.PathLike):
217+
raise FileNotFoundError(f"Could neither find {source} nor {pathlib.Path(root_path) / source}")
216218

217219
if isinstance(source, str):
218220
uri = fields.URI().deserialize(source)

0 commit comments

Comments
 (0)