From 12c1829b78da1d8dfe9e67a4bcf561224557e4f8 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 15 Jul 2011 19:56:06 +0200 Subject: [PATCH] Fix logic error in _load_library --- scikits/image/io/_plugins/freeimage_plugin.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/scikits/image/io/_plugins/freeimage_plugin.py b/scikits/image/io/_plugins/freeimage_plugin.py index 8ae5c408..d933eaef 100644 --- a/scikits/image/io/_plugins/freeimage_plugin.py +++ b/scikits/image/io/_plugins/freeimage_plugin.py @@ -32,19 +32,18 @@ def _load_library(libname, loader_path): libdir = os.path.dirname(loader_path) else: libdir = loader_path - if sys.platform == 'win32': - loader = ctypes.windll - else: - loader = ctypes.cdll - for ln in libname_ext: - try: - return loader[os.path.join(libdir, ln)] - except OSError: - pass - # TODO: Setup errno and other bits to something correctly - raise OSError( - 'Unable to find library in any of the foloowing paths: %s' % - [os.path.join(libdir, ln) for ln in libname_ext]) + if sys.platform == 'win32': + loader = ctypes.windll + else: + loader = ctypes.cdll + for ln in libname_ext: + try: + return loader[os.path.join(libdir, ln)] + except OSError: + pass + # TODO: Setup errno and other bits to something correctly + raise OSError('Unable to find library in any of the foloowing paths: %s' % + [os.path.join(libdir, ln) for ln in libname_ext]) lib_dirs = [os.path.dirname(__file__),