File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -445,8 +445,6 @@ Directory and files operations
445
445
446
446
Return the path to an executable which would be run if the given *cmd * was
447
447
called. If no *cmd * would be called, return ``None ``.
448
- If *cmd * contains a directory component, *which * will only check the specified path directly
449
- and will not search the directories listed in *path * or in the system's ``PATH `` environment variable.
450
448
451
449
*mode * is a permission mask passed to :func: `os.access `, by default
452
450
determining if the file exists and is executable.
@@ -456,6 +454,12 @@ Directory and files operations
456
454
:envvar: `PATH ` environment variable is read from :data: `os.environ `,
457
455
falling back to :data: `os.defpath ` if it is not set.
458
456
457
+ .. note ::
458
+
459
+ If *cmd * contains a directory component, :func: `!which ` only checks the
460
+ specified path directly and does not search the directories listed in *path *
461
+ or in the system's ``PATH `` environment variable.
462
+
459
463
On Windows, the current directory is prepended to the *path * if *mode * does
460
464
not include ``os.X_OK ``. When the *mode * does include ``os.X_OK ``, the
461
465
Windows API ``NeedCurrentDirectoryForExePathW `` will be consulted to
You can’t perform that action at this time.
0 commit comments