MCPcopy Create free account
hub / github.com/ipython/ipython / _find_cmd

Function _find_cmd

IPython/utils/_process_cli.py:25–32  ·  view source on GitHub ↗

Find the full path to a command using which.

(cmd)

Source from the content-addressed store, hash-verified

23from ._process_common import arg_split
24
25def _find_cmd(cmd):
26 """Find the full path to a command using which."""
27 paths = System.Environment.GetEnvironmentVariable("PATH").Split(os.pathsep)
28 for path in paths:
29 filename = os.path.join(path, cmd)
30 if System.IO.File.Exists(filename):
31 return py3compat.decode(filename)
32 raise OSError("command %r not found" % cmd)
33
34def system(cmd):
35 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected