We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7562b59 commit 9e111ddCopy full SHA for 9e111dd
nibabel/loadsave.py
@@ -9,6 +9,7 @@
9
# module imports
10
""" Utilities to load and save image objects """
11
12
+import os.path as op
13
import numpy as np
14
import warnings
15
@@ -34,6 +35,8 @@ def load(filename, **kwargs):
34
35
img : ``SpatialImage``
36
Image of guessed type
37
'''
38
+ if not op.exists(filename):
39
+ raise FileNotFoundError("No such file: '%s'" % filename)
40
sniff = None
41
for image_klass in all_image_classes:
42
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
0 commit comments