Commit 468b8759 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

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
Pipeline #47788 passed with stages
in 9 minutes and 12 seconds
......@@ -140,6 +140,8 @@ def load(inputs):
from collections import Iterable
import numpy
if _is_string(inputs):
if not os.path.exists(inputs):
raise RuntimeError(f"`{inputs}' does not exist!")
return File(inputs, 'r').read()
elif isinstance(inputs, Iterable):
retval = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment