(fd, data)
| 51 | return output |
| 52 | |
| 53 | def blockingWriteToFD(fd, data): |
| 54 | # Another quick twist |
| 55 | while True: |
| 56 | try: |
| 57 | data_length = len(data) |
| 58 | wrote_data = os.write(fd, data) |
| 59 | except (OSError, IOError) as io: |
| 60 | if io.errno in (errno.EAGAIN, errno.EINTR): |
| 61 | continue |
| 62 | else: |
| 63 | raise |
| 64 | |
| 65 | if wrote_data < data_length: |
| 66 | blockingWriteToFD(fd, data[wrote_data:]) |
| 67 | |
| 68 | break |
| 69 | |
| 70 | # the following code is taken from http://code.activestate.com/recipes/440554-module-to-allow-asynchronous-subprocess-use-on-win/ |
| 71 | class Popen(subprocess.Popen): |
no test coverage detected
searching dependent graphs…