def Send_Message(self, encryptionNeeded, encryptionAlgorithm, key, message): if encryptionNeeded == True: from Encryption import Encryption message = Encryption.Encrypt_Message(self, key, message) try: self.connection.send(message.encode()) except: self.connection.send(message)