mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-31 12:41:20 +08:00
Merge pull request #222 from thewtex/freeimage_error_2
BUG: Fix tests when FreeImage is not installed.
This commit is contained in:
@@ -72,13 +72,13 @@ def load_freeimage():
|
||||
# No freeimage library loaded, and load-errors reported for some
|
||||
# candidate libs
|
||||
err_txt = ['%s:\n%s' % (l, str(e.message)) for l, e in errors]
|
||||
raise OSError('One or more FreeImage libraries were found, but '
|
||||
'could not be loaded due to the following errors:\n'
|
||||
'\n\n'.join(err_txt))
|
||||
raise RuntimeError('One or more FreeImage libraries were found, but '
|
||||
'could not be loaded due to the following errors:\n'
|
||||
'\n\n'.join(err_txt))
|
||||
else:
|
||||
# No errors, because no potential libraries found at all!
|
||||
raise OSError('Could not find a FreeImage library in any of:\n' +
|
||||
'\n'.join(lib_dirs))
|
||||
raise RuntimeError('Could not find a FreeImage library in any of:\n' +
|
||||
'\n'.join(lib_dirs))
|
||||
|
||||
# FreeImage found
|
||||
@functype(None, ctypes.c_int, ctypes.c_char_p)
|
||||
|
||||
@@ -11,7 +11,7 @@ try:
|
||||
import skimage.io._plugins.freeimage_plugin as fi
|
||||
FI_available = True
|
||||
sio.use_plugin('freeimage')
|
||||
except OSError:
|
||||
except RuntimeError:
|
||||
FI_available = False
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def setup_module(self):
|
||||
"""
|
||||
try:
|
||||
sio.use_plugin('freeimage')
|
||||
except OSError:
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ try:
|
||||
io.use_plugin('freeimage')
|
||||
FI_available = True
|
||||
priority_plugin = 'freeimage'
|
||||
except OSError:
|
||||
except RuntimeError:
|
||||
FI_available = False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user