Revert "[Utils] Refactor update_cc_test_checks.py to use shutil"

This reverts commit 2e6c50855b.

This caused failures on windows bots:
- https://lab.llvm.org/buildbot/#/builders/216/builds/10030
- https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8802513693562827489/overview
This commit is contained in:
Ben Dunbobbin 2022-09-20 16:50:18 +01:00
parent 09cb9fdef9
commit 837caa99a2
1 changed files with 3 additions and 3 deletions

View File

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