summaryrefslogtreecommitdiff
path: root/paramiko/packet.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-05-31 18:18:33 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-05-31 18:18:33 -0700
commit7a2c893d95651ad1f4667f7e4480da149069b7ff (patch)
treeb716894dd4ab0491bb7fee7f3b12149d3f8912c7 /paramiko/packet.py
parent25de2a02048897752df356189017b22a49d37f88 (diff)
downloadparamiko-7a2c893d95651ad1f4667f7e4480da149069b7ff.tar.gz
Even moar parentheses over backslashes
Diffstat (limited to 'paramiko/packet.py')
-rw-r--r--paramiko/packet.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py
index 6f3cd4e2..16288a0a 100644
--- a/paramiko/packet.py
+++ b/paramiko/packet.py
@@ -394,9 +394,11 @@ class Packetizer (object):
self.__sent_bytes += len(out)
self.__sent_packets += 1
- if (self.__sent_packets >= self.REKEY_PACKETS or
- self.__sent_bytes >= self.REKEY_BYTES)\
- and not self.__need_rekey:
+ sent_too_much = (
+ self.__sent_packets >= self.REKEY_PACKETS or
+ self.__sent_bytes >= self.REKEY_BYTES
+ )
+ if sent_too_much and not self.__need_rekey:
# only ask once for rekeying
self._log(DEBUG, 'Rekeying (hit %d packets, %d bytes sent)' %
(self.__sent_packets, self.__sent_bytes))
@@ -506,9 +508,11 @@ class Packetizer (object):
self.__logger.log(level, msg)
def _check_keepalive(self):
- if (not self.__keepalive_interval) or \
- (not self.__block_engine_out) or \
- self.__need_rekey:
+ if (
+ not self.__keepalive_interval or
+ not self.__block_engine_out or
+ self.__need_rekey
+ ):
# wait till we're encrypting, and not in the middle of rekeying
return
now = time.time()