Show More
@@ -45,7 +45,7 b' class StreamFeeder(Thread):' | |||
|
45 | 45 | self.bytes = bytes(source) |
|
46 | 46 | else: # can be either file pointer or file-like |
|
47 | 47 | if type(source) in (int, long): # file pointer it is |
|
48 |
|
|
|
48 | # converting file descriptor (int) stdin into file-like | |
|
49 | 49 | try: |
|
50 | 50 | source = os.fdopen(source, 'rb', 16384) |
|
51 | 51 | except Exception: |
@@ -118,7 +118,7 b' class InputStreamChunker(Thread):' | |||
|
118 | 118 | t = self.target |
|
119 | 119 | cs = self.chunk_size |
|
120 | 120 | ccm = self.chunk_count_max |
|
121 | kr = self.keep_reading | |
|
121 | keep_reading = self.keep_reading | |
|
122 | 122 | da = self.data_added |
|
123 | 123 | go = self.go |
|
124 | 124 | |
@@ -129,15 +129,13 b' class InputStreamChunker(Thread):' | |||
|
129 | 129 | |
|
130 | 130 | while b and go.is_set(): |
|
131 | 131 | if len(t) > ccm: |
|
132 | kr.clear() | |
|
133 | kr.wait(2) | |
|
134 | # # this only works on 2.7.x and up | |
|
135 |
|
|
|
136 | # raise Exception("Timed out while waiting for input to be read.") | |
|
137 | # instead we'll use this | |
|
138 | if len(t) > ccm + 3: | |
|
139 | raise IOError( | |
|
140 | "Timed out while waiting for input from subprocess.") | |
|
132 | keep_reading.clear() | |
|
133 | keep_reading.wait(2) | |
|
134 | ||
|
135 | if not keep_reading.wait(10): | |
|
136 | raise Exception( | |
|
137 | "Timed out while waiting for input to be read.") | |
|
138 | ||
|
141 | 139 | t.append(b) |
|
142 | 140 | da.set() |
|
143 | 141 | b = s.read(cs) |
General Comments 0
You need to be logged in to leave comments.
Login now