Skip to content
Snippets Groups Projects
Commit 468b8759 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch 'load' into 'master'

[bob.io.base.load] Raise a proper error if the file does not exist

See merge request !33
parents edf71158 beb3c020
No related branches found
No related tags found
1 merge request!33[bob.io.base.load] Raise a proper error if the file does not exist
Pipeline #47788 passed
...@@ -140,6 +140,8 @@ def load(inputs): ...@@ -140,6 +140,8 @@ def load(inputs):
from collections import Iterable from collections import Iterable
import numpy import numpy
if _is_string(inputs): if _is_string(inputs):
if not os.path.exists(inputs):
raise RuntimeError(f"`{inputs}' does not exist!")
return File(inputs, 'r').read() return File(inputs, 'r').read()
elif isinstance(inputs, Iterable): elif isinstance(inputs, Iterable):
retval = [] retval = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment