]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132971: Update shutil.which() docs (GH-133067)
authorKokona <125976684+985025074@users.noreply.github.com>
Sat, 10 May 2025 07:06:19 +0000 (15:06 +0800)
committerGitHub <noreply@github.com>
Sat, 10 May 2025 07:06:19 +0000 (10:06 +0300)
Doc/library/shutil.rst

index 2cbf95bcf535e4bf6019c54abd49e402bc5422ad..c78dfe1aafa0ed0b29f59f23910a5d4d113acdde 100644 (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