Skip to content

Commit

Permalink
follow up for PR python-cffi#119: remove more msvccompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Oct 13, 2024
1 parent a41dadc commit 17f1457
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 17f1457

Please sign in to comment.