Fixing little bug with warnings

This commit is contained in:
Piotr Lizonczyk
2017-09-03 14:32:32 +02:00
parent 368d401701
commit 57a64fc05e

View File

@@ -129,7 +129,7 @@ class NoiseProtocol(object):
if self.keypairs[keypair] is None:
raise NoiseValidationError('Keypair {} has to be set for chosen handshake pattern'.format(keypair))
if not isinstance(self.keypairs['e'], Empty) or not isinstance(self.keypairs['re'], Empty):
if self.keypairs['e'] is not None or self.keypairs['re'] is not None:
warnings.warn('One of ephemeral keypairs is already set. '
'This is OK for testing, but should NEVER happen in production!')