8000 Merge pull request #12209 from anntzer/get_build_arch · numpy/numpy@2be1544 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2be1544

Browse files
authored
Merge pull request #12209 from anntzer/get_build_arch
MAINT: delay import of distutils.msvccompiler to avoid warning on non-Windows.
2 parents ed64256 + 8589e8d commit 2be1544

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

numpy/distutils/misc_util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import distutils
1515
from distutils.errors import DistutilsError
16-
from distutils.msvccompiler import get_build_architecture
1716
try:
1817
from threading import local as tlocal
1918
except ImportError:
@@ -2336,3 +2335,9 @@ def msvc_version(compiler):
23362335
raise ValueError("Compiler instance is not msvc (%s)"\
23372336
% compiler.compiler_type)
23382337
return compiler._MSVCCompiler__version
2338+
2339+
def get_build_architecture():
2340+
# Importing distutils.msvccompiler triggers a warning on non-Windows
2341+
# systems, so delay the import to here.
2342+
from distutils.msvccompiler import get_build_architecture
2343+
return get_build_architecture()

0 commit comments

Comments
 (0)
0