Skip to content

Commit 65e8932

Browse files
committed
TST: Use IOError for Python 2 support.
1 parent 9e111dd commit 65e8932

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nibabel/loadsave.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def load(filename, **kwargs):
3636
Image of guessed type
3737
'''
3838
if not op.exists(filename):
39-
raise FileNotFoundError("No such file: '%s'" % filename)
39+
raise IOError("No such file: '%s'" % filename)
4040
sniff = None
4141
for image_klass in all_image_classes:
4242
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)

nibabel/tests/test_loadsave.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_read_img_data():
5454

5555

5656
def test_file_not_found():
57-
assert_raises(FileNotFoundError, load, 'does_not_exist.nii.gz')
57+
assert_raises(IOError, load, 'does_not_exist.nii.gz')
5858

5959

6060
def test_read_img_data_nifti():

0 commit comments

Comments
 (0)