TypeError being thrown on vista instead of OSError.
This commit is contained in:
parent
1a14773447
commit
22fbb97d56
1 changed files with 4 additions and 4 deletions
|
|
@ -83,7 +83,7 @@ def read_config_file():
|
||||||
that we currently care about is still in the svn trunk at openjpeg.org.
|
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.
|
We must use a configuration file that the user must write.
|
||||||
"""
|
"""
|
||||||
lib = {}
|
lib = {'openjp2': None, 'openjpeg': None}
|
||||||
filename = glymurrc_fname()
|
filename = glymurrc_fname()
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
# Read the configuration file for the library location.
|
# Read the configuration file for the library location.
|
||||||
|
|
@ -92,11 +92,11 @@ def read_config_file():
|
||||||
try:
|
try:
|
||||||
lib['openjp2'] = parser.get('library', 'openjp2')
|
lib['openjp2'] = parser.get('library', 'openjp2')
|
||||||
except NoOptionError:
|
except NoOptionError:
|
||||||
lib['openjp2'] = None
|
pass
|
||||||
try:
|
try:
|
||||||
lib['openjpeg'] = parser.get('library', 'openjpeg')
|
lib['openjpeg'] = parser.get('library', 'openjpeg')
|
||||||
except NoOptionError:
|
except NoOptionError:
|
||||||
lib['openjpeg'] = None
|
pass
|
||||||
|
|
||||||
return lib
|
return lib
|
||||||
|
|
||||||
|
|
@ -113,7 +113,7 @@ def load_openjp2(libopenjp2_path):
|
||||||
openjp2_lib = ctypes.windll.LoadLibrary(libopenjp2_path)
|
openjp2_lib = ctypes.windll.LoadLibrary(libopenjp2_path)
|
||||||
else:
|
else:
|
||||||
openjp2_lib = ctypes.CDLL(libopenjp2_path)
|
openjp2_lib = ctypes.CDLL(libopenjp2_path)
|
||||||
except OSError:
|
except (TypeError, OSError):
|
||||||
msg = '"Library {0}" could not be loaded. Operating in degraded mode.'
|
msg = '"Library {0}" could not be loaded. Operating in degraded mode.'
|
||||||
msg = msg.format(libopenjp2_path)
|
msg = msg.format(libopenjp2_path)
|
||||||
warnings.warn(msg, UserWarning)
|
warnings.warn(msg, UserWarning)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue