Skip to content

Commit

Permalink
Prefer non-deprecated MSVCCompiler import
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshilliard committed Aug 29, 2024
1 parent 9ba9c1e commit 5152891
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cffi/_shimmed_dist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
from distutils.log import set_threshold, set_verbosity

if sys.platform == 'win32':
from distutils.msvc9compiler import MSVCCompiler
try:
from distutils.msvccompiler import MSVCCompiler
except ImportError:
from distutils.msvc9compiler import MSVCCompiler
except Exception as ex:
if sys.version_info >= (3, 12):
raise Exception("This CFFI feature requires setuptools on Python >= 3.12. Please install the setuptools package.") from ex
Expand Down

0 comments on commit 5152891

Please sign in to comment.