MCPcopy Index your code
hub / github.com/python/cpython / _win_path_needs_curdir

Function _win_path_needs_curdir

Lib/shutil.py:1568–1575  ·  view source on GitHub ↗

On Windows, we can use NeedCurrentDirectoryForExePath to figure out if we should add the cwd to PATH when searching for executables if the mode is executable.

(cmd, mode)

Source from the content-addressed store, hash-verified

1566
1567
1568def _win_path_needs_curdir(cmd, mode):
1569 """
1570 On Windows, we can use NeedCurrentDirectoryForExePath to figure out
1571 if we should add the cwd to PATH when searching for executables if
1572 the mode is executable.
1573 """
1574 return (not (mode & os.X_OK)) or _winapi.NeedCurrentDirectoryForExePath(
1575 os.fsdecode(cmd))
1576
1577
1578def which(cmd, mode=os.F_OK | os.X_OK, path=None):

Callers 1

whichFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…