diff options
author | Neil Muller <?@?> | 2010-11-20 11:15:54 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-11-20 11:29:27 -0700 |
commit | 12d020070e8c6698500103889f55bd36dfcab374 (patch) | |
tree | 9a350955a9af64d3083e09f5ea32887199de79cb | |
parent | ced0e77e34e3d46edd4e47178060b3abfc1f9221 (diff) | |
download | numpy-12d020070e8c6698500103889f55bd36dfcab374.tar.gz |
BUG: Fix exception handling for python 3k.
-rw-r--r-- | numpy/ctypeslib.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/ctypeslib.py b/numpy/ctypeslib.py index ccaa3cfd6..1fdf3c396 100644 --- a/numpy/ctypeslib.py +++ b/numpy/ctypeslib.py @@ -93,7 +93,6 @@ else: "with ctypes < 1.0.1") ext = os.path.splitext(libname)[1] - if not ext: # Try to load library with platform-specific name, otherwise # default to libname.[so|pyd]. Sometimes, these files are built @@ -112,14 +111,15 @@ else: else: libdir = loader_path + # Need to save exception when using Python 3k, see PEP 3110. + exc = None for ln in libname_ext: try: libpath = os.path.join(libdir, ln) return ctypes.cdll[libpath] except OSError, e: - pass - - raise e + exc = e + raise exc ctypes_load_library = deprecate(load_library, 'ctypes_load_library', 'load_library') |