def METHOD_NAME(self, stdout):
    while self._proc.poll() is None:
        line = stdout.readline()
        if line:
            self.parse(line)
    # consume all extra lines if the proc exits.
    with contextlib.suppress(Exception):
        for line in stdout.readlines():
            if line:
                self.parse(line)