| 59 | | output = pipeout.read() |
|---|
| 60 | | if (# Windows |
|---|
| 61 | | output.startswith("'%s' is not recognized" % cmd) |
|---|
| 62 | | # bash |
|---|
| 63 | | or re.match(r"bash: .*: (No such file|command not found)", output) |
|---|
| 64 | | ): |
|---|
| 65 | | raise IOError('%s must be on your system path.' % cmd) |
|---|
| 66 | | pipeout.close() |
|---|
| | 59 | try: |
|---|
| | 60 | firstline = pipeout.readline() |
|---|
| | 61 | if (re.search(r"(not recognized|No such file|not found)", firstline, |
|---|
| | 62 | re.IGNORECASE)): |
|---|
| | 63 | raise IOError('%s must be on your system path.' % cmd) |
|---|
| | 64 | output = firstline + pipeout.read() |
|---|
| | 65 | finally: |
|---|
| | 66 | pipeout.close() |
|---|