Skip to content

Commit 19f50dd

Browse files
committed
Prefer non-deprecated MSVCCompiler import
1 parent 9ba9c1e commit 19f50dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cffi/_shimmed_dist_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
from distutils.log import set_threshold, set_verbosity
3131

3232
if sys.platform == 'win32':
33-
from distutils.msvc9compiler import MSVCCompiler
33+
try:
34+
from distutils.msvccompiler import MSVCCompiler
35+
except ImportError:
36+
from distutils.msvc9compiler import MSVCCompiler
3437
except Exception as ex:
3538
if sys.version_info >= (3, 12):
3639
raise Exception("This CFFI feature requires setuptools on Python >= 3.12. Please install the setuptools package.") from ex

0 commit comments

Comments
 (0)