Skip to content

Commit

Permalink
fix windows tests for distutils from setuptools>73
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Oct 29, 2024
1 parent 4e7ebbd commit 9bf2c92
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions testing/cffi0/test_ownlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,15 @@ def setup_class(cls):
return
# try (not too hard) to find the version used to compile this python
# no mingw
from distutils.msvc9compiler import get_build_version
version = get_build_version()
toolskey = "VS%0.f0COMNTOOLS" % version
toolsdir = os.environ.get(toolskey, None)
toolsdir = None
try:
# This will always fail on setuptools>73 which removes msvc9compiler
from distutils.msvc9compiler import get_build_version
version = get_build_version()
toolskey = "VS%0.f0COMNTOOLS" % version
toolsdir = os.environ.get(toolskey, None)
except Exception:
pass
if toolsdir is None:
return
productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
Expand Down

0 comments on commit 9bf2c92

Please sign in to comment.