[all-commits] [llvm/llvm-project] 14869b: [lldb] Use shutil.which instead of distutils find_...

David Spickett via All-commits all-commits at lists.llvm.org
Fri Apr 29 01:41:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 14869bd2dfabb7a808e57e17dd45eef7665dd737
      https://github.com/llvm/llvm-project/commit/14869bd2dfabb7a808e57e17dd45eef7665dd737
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/test/Shell/lit.cfg.py

  Log Message:
  -----------
  [lldb] Use shutil.which instead of distutils find_executable

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

It was added in Python3.3 but given that we're already using
shutil.which elsewhere I think this is ok/no worse than before.

We do have our own find_executable in lldb/test/Shell/helper/build.py
but I'd rather leave that as is for now. Also we have our own versions
of which() but again, a change for another time.

This work is part of #54337.

Reviewed By: JDevlieghere

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




More information about the All-commits mailing list