(cmd, args='')
| 287 | |
| 288 | |
| 289 | def read_process(cmd, args=''): |
| 290 | fullcmd = '%s %s' % (cmd, args) |
| 291 | pipeout = popen(fullcmd) |
| 292 | try: |
| 293 | firstline = pipeout.readline() |
| 294 | cmd_not_found = re.search( |
| 295 | b'(not recognized|No such file|not found)', |
| 296 | firstline, |
| 297 | re.IGNORECASE |
| 298 | ) |
| 299 | if cmd_not_found: |
| 300 | raise IOError('%s must be on your system path.' % cmd) |
| 301 | output = firstline + pipeout.read() |
| 302 | finally: |
| 303 | pipeout.close() |
| 304 | return output |
| 305 | |
| 306 | |
| 307 | class ModPythonServer(object): |