'Read until a given string is encountered or until timeout.
When no match is found, return whatever is available instead,
possibly the empty string.  Raise EOFError if the connection
is closed and no cooked data is available.'

def read_until(self, match, timeout=None):

    if self._has_poll:
        return self._read_until_with_poll(match, timeout)
    else:
        return self._read_until_with_select(match, timeout)
