Show More
@@ -382,9 +382,21 b' class StreamCapturer(Thread):' | |||||
382 | continue |
|
382 | continue | |
383 |
|
383 | |||
384 | ready = select(streams, [], [], 0.5)[0] |
|
384 | ready = select(streams, [], [], 0.5)[0] | |
|
385 | dead = [] | |||
385 | with self.buffer_lock: |
|
386 | with self.buffer_lock: | |
386 | for fd in ready: |
|
387 | for fd in ready: | |
387 | self.buffer.write(os.read(fd, 1024)) |
|
388 | try: | |
|
389 | self.buffer.write(os.read(fd, 1024)) | |||
|
390 | except OSError as e: | |||
|
391 | import errno | |||
|
392 | if e.errno == errno.EBADF: | |||
|
393 | dead.append(fd) | |||
|
394 | else: | |||
|
395 | raise | |||
|
396 | ||||
|
397 | with self.streams_lock: | |||
|
398 | for fd in dead: | |||
|
399 | self.streams.remove(fd) | |||
388 |
|
400 | |||
389 | def add_stream(self, fd): |
|
401 | def add_stream(self, fd): | |
390 | with self.streams_lock: |
|
402 | with self.streams_lock: |
General Comments 0
You need to be logged in to leave comments.
Login now