From 22fbb97d5637c29c4e528ce6dd4ba45ae18a91ce Mon Sep 17 00:00:00 2001 From: "U-john-PC\\john" Date: Wed, 10 Jul 2013 08:02:44 -0400 Subject: [PATCH] TypeError being thrown on vista instead of OSError. --- glymur/lib/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glymur/lib/config.py b/glymur/lib/config.py index 7d1ebe7..a64ff37 100644 --- a/glymur/lib/config.py +++ b/glymur/lib/config.py @@ -83,7 +83,7 @@ def read_config_file(): that we currently care about is still in the svn trunk at openjpeg.org. We must use a configuration file that the user must write. """ - lib = {} + lib = {'openjp2': None, 'openjpeg': None} filename = glymurrc_fname() if filename is not None: # Read the configuration file for the library location. @@ -92,11 +92,11 @@ def read_config_file(): try: lib['openjp2'] = parser.get('library', 'openjp2') except NoOptionError: - lib['openjp2'] = None + pass try: lib['openjpeg'] = parser.get('library', 'openjpeg') except NoOptionError: - lib['openjpeg'] = None + pass return lib @@ -113,7 +113,7 @@ def load_openjp2(libopenjp2_path): openjp2_lib = ctypes.windll.LoadLibrary(libopenjp2_path) else: openjp2_lib = ctypes.CDLL(libopenjp2_path) - except OSError: + except (TypeError, OSError): msg = '"Library {0}" could not be loaded. Operating in degraded mode.' msg = msg.format(libopenjp2_path) warnings.warn(msg, UserWarning)