def removeCMSPadding(str, blocksize=AES_blocksize):
  '''CMS padding: Remove padding with bytes containing the number of padding bytes '''
  try:
    pad_len = ord(str[-1]) # last byte contains number of padding bytes
  except TypeError:
    pad_len = str[-1]
  assert blocksize <= pad_len, 'padding error' 
  assert pad_len <= len(str), 'padding error'
    
  return str[:-pad_len]
dataset/ETHPy150Open keenlabs/KeenClient-Python/keen/Padding.py/removeCMSPadding/swapped operands of `<=`