Commit beb3c020 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

[] Raise a proper error if the file does not exist

parent edf71158
Pipeline #45865 passed with stage
in 12 minutes and 17 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
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment