setup.py
branchstable
changeset 51682 6388fd855f66
parent 51663 45ba8416afc4
--- a/setup.py	Wed Aug 07 22:05:36 2024 +0200
+++ b/setup.py	Thu Sep 05 15:37:14 2024 -0400
@@ -1662,7 +1662,11 @@
     # Allow compiler/linker flags to be added to Visual Studio builds.  Passing
     # extra_link_args to distutils.extensions.Extension() doesn't have any
     # effect.
-    from distutils import msvccompiler
+    try:
+        # setuptools < 65.0
+        from distutils import msvccompiler
+    except ImportError:
+        from distutils import _msvccompiler as msvccompiler
 
     msvccompilerclass = msvccompiler.MSVCCompiler