(exe, dirs)
| 106 | |
| 107 | |
| 108 | def _which(exe, dirs): |
| 109 | # return full path of an executable. |
| 110 | p = _exes.get(exe, None) |
| 111 | if p is None: |
| 112 | for d in dirs: |
| 113 | p = os.path.join(d, exe) |
| 114 | if os.access(p, os.X_OK): |
| 115 | break |
| 116 | else: |
| 117 | p = '' # no such exe |
| 118 | _exes[exe] = p |
| 119 | if _debugf: |
| 120 | _debugf('_which(%r): %r', exe, p) |
| 121 | return p |
| 122 | |
| 123 | |
| 124 | if sys.platform.startswith('win'): |
no test coverage detected