(command, args)
| 251 | |
| 252 | |
| 253 | def _popen(command, args): |
| 254 | # type: (str, str) -> str |
| 255 | for directory in PATH: |
| 256 | executable = os.path.join(directory, command) |
| 257 | if ( |
| 258 | os.path.exists(executable) |
| 259 | and os.access(executable, os.F_OK | os.X_OK) |
| 260 | and not os.path.isdir(executable) |
| 261 | ): |
| 262 | break |
| 263 | else: |
| 264 | executable = command |
| 265 | |
| 266 | if DEBUG >= 3: |
| 267 | log.debug("Running: '%s %s'", executable, args) |
| 268 | |
| 269 | return _call_proc(executable, args) |
| 270 | |
| 271 | |
| 272 | def _call_proc(executable, args): |