77from distutils .sysconfig import get_python_lib , get_config_vars
88from distutils .dist import DistributionMetadata
99from distutils .command .install_data import install_data
10- from distutils .spawn import find_executable
1110import subprocess
1211from tempfile import TemporaryFile
1312import fnmatch
1413import io
1514import os
1615import platform
17- from shutil import copy2 , copyfile , rmtree
16+ from shutil import copy2 , copyfile , rmtree , which
1817import sys
1918import tempfile
2019import atexit
@@ -58,7 +57,7 @@ def win_find_clang_path():
5857 return winreg .QueryValueEx (rkey , None )[0 ]
5958 except FileNotFoundError :
6059 # Visual Studio ships with an optional Clang distribution, try to detect it
61- clang_cl = find_executable ("clang-cl" )
60+ clang_cl = which ("clang-cl" )
6261 if clang_cl is None :
6362 return None
6463 return os .path .abspath (os .path .join (os .path .dirname (clang_cl ), ".." , ".." ))
@@ -93,7 +92,7 @@ def win_use_clang():
9392
9493 # If you run the installation from a Visual Studio command prompt link.exe will already exist
9594 # Fall back to LLVM's lld-link.exe which is compatible with link's command line
96- if find_executable ("link" ) is None :
95+ if which ("link" ) is None :
9796 # LLVM >= 14.0.0 started supporting the /LTCG flag
9897 # Earlier versions will error during the linking phase so bail out now
9998 if clang_version [0 ] < 14 :
@@ -110,7 +109,7 @@ def win_use_clang():
110109build_warnings = []
111110win_force_clang = False
112111if is_win :
113- if is_64bit or find_executable ("cl" ) is None :
112+ if is_64bit or which ("cl" ) is None :
114113 # We do not change to clang if under 32 bits, because even with Clang we
115114 # do not use uint128_t with the 32 bits ABI. Regardless we can try to
116115 # find it when building in 32-bit mode if cl.exe was not found in the PATH.
@@ -119,8 +118,8 @@ def win_use_clang():
119118 build_warnings .append ("Could not find a suitable Clang/LLVM installation. You can download LLVM from https://releases.llvm.org" )
120119 build_warnings .append ("Alternatively you can select the 'C++ Clang-cl build tools' in the Visual Studio Installer" )
121120 build_extensions = False
122- cl = find_executable ("cl" )
123- link = find_executable ("link" )
121+ cl = which ("cl" )
122+ link = which ("link" )
124123 if cl is None or link is None :
125124 build_warnings .append ("Could not find cl.exe and/or link.exe in the PATH, try building miasm from a Visual Studio command prompt" )
126125 build_warnings .append ("More information at: https://wiki.python.org/moin/WindowsCompilers" )
@@ -314,7 +313,7 @@ def build_all():
314313 try :
315314 s = setup (
316315 name = "miasm" ,
317- version = __import__ ( "miasm" ). VERSION ,
316+ version = "0.1.5" ,
318317 packages = packages ,
319318 data_files = [("" , ["README.md" ])],
320319 package_data = {
0 commit comments