diff options
author | Steve Dower <steve.dower@microsoft.com> | 2020-05-26 19:13:38 +0100 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2020-05-26 19:13:38 +0100 |
commit | 6541b11c4014650a675f016ba3b2e7a35e5998b8 (patch) | |
tree | fc3dc0db54665b79e5a0b262fdc1b58d0e23ae26 | |
parent | 66cb824d8a266077841e27df955235886f118139 (diff) | |
download | numpy-6541b11c4014650a675f016ba3b2e7a35e5998b8.tar.gz |
Defer ctypes import in generated _distributor_init.py
-rw-r--r-- | tools/openblas_support.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/openblas_support.py b/tools/openblas_support.py index 6b2ad0f8c..cbb6a5e43 100644 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -207,12 +207,12 @@ def make_init(dirname): and is created as part of the scripts that build the wheel. ''' import os - from ctypes import WinDLL import glob if os.name == 'nt': # convention for storing / loading the DLL from # numpy/.libs/, if present try: + from ctypes import WinDLL basedir = os.path.dirname(__file__) except: pass @@ -221,16 +221,16 @@ def make_init(dirname): DLL_filenames = [] if os.path.isdir(libs_dir): for filename in glob.glob(os.path.join(libs_dir, - '*openblas*dll')): + '*openblas*dll')): # NOTE: would it change behavior to load ALL # DLLs at this path vs. the name restriction? 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:\\n%s" % - "\\n".join(DLL_filenames), - stacklevel=1) + if len(DLL_filenames) > 1: + import warnings + warnings.warn("loaded more than 1 DLL from .libs:\\n%s" % + "\\n".join(DLL_filenames), + stacklevel=1) """)) def test_setup(arches): |