def removesuffix(string, suffix):
    """
    Returns <string> without the <suffix> suffix.

    Copied from https://www.python.org/dev/peps/pep-0616/#specification
    to support python versions < 3.9

    :param str string: string from which to remove suffix
    :param str suffix: suffix to remove from string
    :return str: string without suffix
    """
    # suffix='' should not call self[:-0].
    if suffix and string.endswith(suffix):
        return string[:-len(suffix)]
    else:
        return string[:]