[all-commits] [llvm/llvm-project] ee3413: [clang] Replace find_executable with shutil.which ...

David Spickett via All-commits all-commits at lists.llvm.org
Mon Apr 17 08:33:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ee341373625163846f4ebc68e46aec6fb46c2c09
      https://github.com/llvm/llvm-project/commit/ee341373625163846f4ebc68e46aec6fb46c2c09
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    M clang/utils/creduce-clang-crash.py

  Log Message:
  -----------
  [clang] Replace find_executable with shutil.which in creduce script

distutils is deprecated and shutil.which is the suggested
replacement for this function.

https://peps.python.org/pep-0632/#migration-advice
https://docs.python.org/3/library/shutil.html#shutil.which

which was added in 3.3 (https://docs.python.org/3/library/shutil.html#shutil.which)
and LLVM requires at least 3.6 (https://llvm.org/docs/GettingStarted.html#software).

There is one small differnce here that shutil.which ignores the PATH
when given a path argument. However in this case I think that's actually
the behaviour we want.

Reviewed By: zequanwu

Differential Revision: https://reviews.llvm.org/D148529




More information about the All-commits mailing list