[libcxx-commits] [PATCH] D148527: [libcxx] Replace find_executable with shutil.which

David Spickett via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 17 08:01:54 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG268a4b0a4514: [libcxx] Replace find_executable with shutil.which (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148527/new/

https://reviews.llvm.org/D148527

Files:
  libcxx/utils/libcxx/sym_check/extract.py
  libcxx/utils/libcxx/sym_check/util.py


Index: libcxx/utils/libcxx/sym_check/util.py
===================================================================
--- libcxx/utils/libcxx/sym_check/util.py
+++ libcxx/utils/libcxx/sym_check/util.py
@@ -8,8 +8,8 @@
 
 from pprint import pformat
 import ast
-import distutils.spawn
 import re
+import shutil
 import subprocess
 import sys
 
@@ -60,7 +60,7 @@
             f.write(out_str)
 
 
-_cppfilt_exe = distutils.spawn.find_executable('c++filt')
+_cppfilt_exe = shutil.which('c++filt')
 
 
 def demangle_symbol(symbol):
Index: libcxx/utils/libcxx/sym_check/extract.py
===================================================================
--- libcxx/utils/libcxx/sym_check/extract.py
+++ libcxx/utils/libcxx/sym_check/extract.py
@@ -9,10 +9,10 @@
 """
 extract - A set of function that extract symbol lists from shared libraries.
 """
-import distutils.spawn
 import os.path
 from os import environ
 import re
+import shutil
 import subprocess
 import sys
 
@@ -30,7 +30,7 @@
         """
         Search for the nm executable and return the path.
         """
-        return distutils.spawn.find_executable('nm')
+        return shutil.which('nm')
 
     def __init__(self, static_lib):
         """
@@ -119,7 +119,7 @@
         """
         Search for the readelf executable and return the path.
         """
-        return distutils.spawn.find_executable('readelf')
+        return shutil.which('readelf')
 
     def __init__(self, static_lib):
         """
@@ -200,7 +200,7 @@
          """
          Search for the dump executable and return the path.
          """
-         return distutils.spawn.find_executable('dump')
+         return shutil.which('dump')
 
      def __init__(self, static_lib):
          """


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148527.514246.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230417/6f1977dd/attachment-0001.bin>


More information about the libcxx-commits mailing list