setup.py
changeset 51849 4dc1fc2b2f3a
parent 51848 3f0db3b6bf14
child 51901 f0e07efc199f
--- a/setup.py	Thu Sep 05 16:59:36 2024 -0400
+++ b/setup.py	Thu Sep 05 17:12:52 2024 -0400
@@ -125,7 +125,7 @@
 from distutils.command.install_lib import install_lib
 from distutils.command.install_scripts import install_scripts
 from distutils import log
-from distutils.spawn import spawn, find_executable
+from distutils.spawn import spawn
 from distutils import file_util
 from distutils.errors import (
     CCompilerError,
@@ -464,6 +464,12 @@
     description = "build translations (.mo files)"
 
     def run(self):
+        try:
+            from shutil import which as find_executable
+        except ImportError:
+            # Deprecated in py3.12
+            from distutils.spawn import find_executable
+
         if not find_executable('msgfmt'):
             self.warn(
                 "could not find msgfmt executable, no translations "