Return a bytearray with the given suffix string removed if present. If the bytearray ends with the suffix string and that suffix is not empty, return bytearray[:-len(suffix)]. Otherwise, return a copy of the original bytearray.
>>> b'MiscTests'.removesuffix(b'Tests') b'Misc' >>> b'TmpDirMixin'.removesuffix(b'Tests') b'TmpDirMixin'
builtins/bytearray.removesuffix
bytearray.removesuffix