def gpg_exception_factory(returncode, message):
    if returncode == 2:
        if b'decryption failed: bad key' in message:
            return IncorrectPasswordException(message)
        if b'CRC error;' in message:
            return FileCorruptionException(message)
        if b'fatal: zlib inflate problem: invalid distance' in message:
            return FileCorruptionException(message)
        if message in b'decryption failed: invalid packet':
            return FileCorruptionException(message)
        if b'no valid OpenPGP data found':
            return InvalidEncryptedFileException(message)
    return Exception("unkown error", returncode, message)
dataset/ETHPy150Open gavinwahl/sdb/sdb/passwords.py/gpg_exception_factory/swapped operands of `in`