summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2012-06-23 03:48:06 (GMT)
committerBrian Curtin <brian@python.org>2012-06-23 03:48:06 (GMT)
commit2193536e79c33654cadf85f4b6d8bbe27b43fd2c (patch)
tree760799522d7e253b013d67e610b21233f0c07208 /Lib/shutil.py
parentdbbc0c8bb39a8b92692f03491c9384d9c068b9e2 (diff)
downloadcpython-2193536e79c33654cadf85f4b6d8bbe27b43fd2c.zip
cpython-2193536e79c33654cadf85f4b6d8bbe27b43fd2c.tar.gz
cpython-2193536e79c33654cadf85f4b6d8bbe27b43fd2c.tar.bz2
Fix #15148. Make the shutil.which docstring more thorough
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index f375a5b..82d3f09 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -973,7 +973,9 @@ def get_terminal_size(fallback=(80, 24)):
def which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Given a command, mode, and a path string, return the path which
- conforms to the given mode on the path."""
+ conforms to the given mode on the PATH, or None if there is no such file.
+ `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of
+ os.environ.get("PATH"), or can be overridden with a custom search path."""
# Check that a given file can be accessed with the correct mode.
# Additionally check that `file` is not a directory, as on Windows
# directories pass the os.access check.