Same as `which` command of bash.
(cmd)
| 172 | |
| 173 | |
| 174 | def which(cmd): |
| 175 | """Same as `which` command of bash.""" |
| 176 | from distutils.spawn import find_executable |
| 177 | |
| 178 | found = find_executable(cmd) |
| 179 | if not found: |
| 180 | raise Exception("failed to find command: " + cmd) |
| 181 | return found |
| 182 | |
| 183 | |
| 184 | @contextmanager |
no outgoing calls
no test coverage detected