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

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

parent edf71158
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 #45865 passed
......@@ -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 = []
......
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