Skip to content

Commit 781e231

Browse files
authored
Merge pull request numpy#27406 from PinkPandaKatie/fix-27405
BUG: Stub out ``get_build_msvc_version`` if ``distutils.msvccompiler`` cannot be imported
2 parents 3df1665 + 1cc02cc commit 781e231

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

numpy/distutils/mingw32ccompiler.py

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

2525
import distutils.cygwinccompiler
2626
from distutils.unixccompiler import UnixCCompiler
27-
from distutils.msvccompiler import get_build_version as get_build_msvc_version
27+
28+
try:
29+
from distutils.msvccompiler import get_build_version as get_build_msvc_version
30+
except ImportError:
31+
def get_build_msvc_version():
32+
return None
33+
2834
from distutils.errors import UnknownFileError
2935
from numpy.distutils.misc_util import (msvc_runtime_library,
3036
msvc_runtime_version,

0 commit comments

Comments
 (0)