[3.14] gh-132971: Update shutil.which() docs (GH-133067) (#133803)

gh-132971: Update shutil.which() docs (GH-133067)
(cherry picked from commit d13d5fdf61)

Co-authored-by: Kokona <125976684+985025074@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-05-10 10:51:55 +02:00 committed by GitHub
parent 62109c4174
commit 4b78cbd76f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -454,6 +454,10 @@ Directory and files operations
:envvar:`PATH` environment variable is read from :data:`os.environ`,
falling back to :data:`os.defpath` if it is not set.
If *cmd* contains a directory component, :func:`!which` only checks the
specified path directly and does not search the directories listed in
*path* or in the system's :envvar:`PATH` environment variable.
On Windows, the current directory is prepended to the *path* if *mode* does
not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the
Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to