diff options
author | Tyler Reddy <tyler.je.reddy@gmail.com> | 2019-02-22 15:30:17 -0800 |
---|---|---|
committer | Tyler Reddy <tyler.je.reddy@gmail.com> | 2019-02-22 16:38:27 -0800 |
commit | b307d9a88f75f657a6a1238b0fcbd4ee129df4ab (patch) | |
tree | 2c3954f132e449ba1a5be178397d552f0baefd97 | |
parent | 922507bd968cc5e1c17eaf940d1eba3a4b8393b4 (diff) | |
download | numpy-b307d9a88f75f657a6a1238b0fcbd4ee129df4ab.tar.gz |
MAINT: use os.path for Python 2.x compat
-rw-r--r-- | numpy/core/__init__.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py index d97bee487..121f1b59e 100644 --- a/numpy/core/__init__.py +++ b/numpy/core/__init__.py @@ -10,17 +10,18 @@ import os # path resolution portability with an absolute path DLL load if os.name == 'nt': from ctypes import WinDLL - from pathlib import Path + import glob # convention for storing / loading the DLL from # numpy/.libs/, if present - libs_path = Path(Path(__file__).absolute().parents[1], '.libs') + libs_path = os.path.abspath(os.path.join(os.path.dirname(__file__), + '..', '.libs')) DLL_filenames = [] - if libs_path.exists(): - for filename in libs_path.glob('*openblas*dll'): + if os.path.isdir(libs_path): + for filename in glob.glob(os.path.join(libs_path, '*openblas*dll')): # NOTE: would it change behavior to load ALL # DLLs at this path vs. the name restriction? - WinDLL(str(filename.absolute())) - DLL_filenames.append(str(filename)) + WinDLL(os.path.abspath(filename)) + DLL_filenames.append(filename) if len(DLL_filenames) > 1: import warnings warnings.warn("loaded more than 1 DLL from .libs:", |