def __init__(self, popenToWrap):
self._streamLock = threading.Lock()
self._proc = popenToWrap
self._stdout = StringIO()
self._stderr = StringIO()
self._stdin = StringIO()
fdout = self._proc.stdout.fileno()
fderr = self._proc.stderr.fileno()
self._fdin = self._proc.stdin.fileno()
self._closedfds = []
self._poller = select.epoll()
self._poller.register(fdout, select.EPOLLIN | select.EPOLLPRI)
self._poller.register(fderr, select.EPOLLIN | select.EPOLLPRI)
self._poller.register(self._fdin, 0)
self._fdMap = {fdout: self._stdout,
fderr: self._stderr,
self._fdin: self._stdin}
self.stdout = io.BufferedReader(self._streamWrapper(self,
self._stdout, fdout), BUFFSIZE)
self.stderr = io.BufferedReader(self._streamWrapper(self,
self._stderr, fderr), BUFFSIZE)
self.stdin = io.BufferedWriter(self._streamWrapper(self,
self._stdin, self._fdin), BUFFSIZE)
self._returncode = None
self.blocking = False
评论列表
文章目录