def strip_shell_chars(input_str):
    """
    Strips the last '\r' or '\n' or '\r\n' string at the end of
    the input string. This is typically used to strip ``stdout``
    and ``stderr`` streams of those characters.

    :param input_str: Input string to be stripped.
    :type input_str: ``str``

    :rtype: ``str``
    """
    stripped_str = rstrip_last_char(input_str, "\n")
    stripped_str = rstrip_last_char(stripped_str, "\r")
    return stripped_str

    Strips the last '
' or '
' or '
' string at the end of
    the input string. This is typically used to strip ``stdout``
    and ``stderr`` streams of those characters.

    :param input_str: Input string to be stripped.
    :type input_str: ``str``

    :rtype: ``str``
    
st2common/st2common/util/misc.py