add six dependency
Markus Gerstel
6 years ago
5 | 5 | import logging |
6 | 6 | import os |
7 | 7 | import select |
8 | import six | |
8 | 9 | import subprocess |
9 | 10 | import time |
10 | 11 | import timeit |
11 | from cStringIO import StringIO | |
12 | 12 | from multiprocessing import Pipe |
13 | 13 | from threading import Thread |
14 | 14 | |
90 | 90 | '''Reads a stream in a thread to avoid blocking/deadlocks''' |
91 | 91 | def __init__(self, stream, output=True, debug=False, notify=None, callback=None): |
92 | 92 | '''Creates and starts a thread which reads from a stream.''' |
93 | self._buffer = StringIO() | |
93 | self._buffer = six.StringIO() | |
94 | 94 | self._closed = False |
95 | 95 | self._closing = False |
96 | 96 | self._debug = debug |