Find the full path to a command using which.
(cmd)
| 23 | from ._process_common import arg_split |
| 24 | |
| 25 | def _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 | |
| 34 | def system(cmd): |
| 35 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected