rez.utils.which

rez.utils.which.which(cmd: str, mode=1, path: str | None = None, env=None) str | None

A replacement for shutil.which.

Things we do that shutil.which does not:

  • Support specifying env

  • Take into account ‘%systemroot%’ possible presence in path (windows)

  • Take into account symlinks to executables (windows)