[PATCH] D134015: [Utils] Refactor update_cc_test_checks.py to use shutil

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 01:42:27 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2e6c50855b7d: [Utils] Refactor update_cc_test_checks.py to use shutil (authored by jmciver, committed by nlopes).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134015

Files:
  llvm/utils/update_cc_test_checks.py


Index: llvm/utils/update_cc_test_checks.py
===================================================================
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -16,11 +16,11 @@
 
 import argparse
 import collections
-import distutils.spawn
 import json
 import os
 import re
 import shlex
+import shutil
 import subprocess
 import sys
 import tempfile
@@ -167,7 +167,7 @@
   args = common.parse_commandline_args(parser)
   infer_dependent_args(args)
 
-  if not distutils.spawn.find_executable(args.clang):
+  if not shutil.which(args.clang):
     print('Please specify --llvm-bin or --clang', file=sys.stderr)
     sys.exit(1)
 
@@ -183,7 +183,7 @@
     common.warn('Could not determine clang builtins directory, some tests '
                 'might not update correctly.')
 
-  if not distutils.spawn.find_executable(args.opt):
+  if not shutil.which(args.opt):
     # Many uses of this tool will not need an opt binary, because it's only
     # needed for updating a test that runs clang | opt | FileCheck. So we
     # defer this error message until we find that opt is actually needed.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134015.461501.patch
Type: text/x-patch
Size: 1125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/0e172066/attachment.bin>


More information about the llvm-commits mailing list