'Sets the newline used by `Write` keyword in the current connection.
The old newline is returned and can be used to restore the newline later.
See `Set Timeout` for a similar example.
If terminal emulation is used, the newline can not be changed on an open
connection.
See `Configuration` section for more information about global and
connection specific configuration.'

def set_newline(self, newline):

    self._verify_connection()
    if self._terminal_emulator:
        raise AssertionError('Newline    can    not    be    changed    when    terminal    emulation    is    used.')
    old = self._newline
    self._set_newline(newline)
    return old
