Skip to content

Commit ab338cc

Browse files
committed
fix windows tests for distutils from setuptools>73
1 parent 8278928 commit ab338cc

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

testing/cffi0/test_ownlib.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,15 @@ def setup_class(cls):
142142
return
143143
# try (not too hard) to find the version used to compile this python
144144
# no mingw
145-
from distutils.msvc9compiler import get_build_version
146-
version = get_build_version()
147-
toolskey = "VS%0.f0COMNTOOLS" % version
148-
toolsdir = os.environ.get(toolskey, None)
145+
toolsdir = None
146+
try:
147+
# This will always fail on setuptools>73 which removes msvc9compiler
148+
from distutils.msvc9compiler import get_build_version
149+
version = get_build_version()
150+
toolskey = "VS%0.f0COMNTOOLS" % version
151+
toolsdir = os.environ.get(toolskey, None)
152+
except Exception:
153+
pass
149154
if toolsdir is None:
150155
return
151156
productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")

0 commit comments

Comments
 (0)