def _read_incoming(self):
        while 1:
            buf = ''
            try:
                buf = os.read(self.child_fd, 1024)
            except __HOLE__ as e:
                self._log(e, 'read')

            if not buf:
                self.flag_eof = True
                return

            self._read_queue.put(buf.decode('utf-8'))
            time.sleep(0.001)
dataset/ETHPy150Open Calysto/metakernel/metakernel/pexpect.py/spawn._read_incoming