From 8589f01d3d167e0195083bff231717b5037eb42c Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 2 Sep 2019 16:56:38 +0530 Subject: [PATCH] downloadthread.py flake8 fixes --- src/network/downloadthread.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index 308dffcb..5aaff614 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -38,10 +38,13 @@ class DownloadThread(StoppableThread): while not self._stopped: requested = 0 # Choose downloading peers randomly - connections = [x for x in BMConnectionPool().inboundConnections.values() + BMConnectionPool().outboundConnections.values() if x.fullyEstablished] + connections = [ + x for x in + BMConnectionPool().inboundConnections.values() + BMConnectionPool().outboundConnections.values() + if x.fullyEstablished] helper_random.randomshuffle(connections) try: - requestChunk = max(int(min(DownloadThread.maxRequestChunk, len(missingObjects)) / len(connections)), 1) + requestChunk = max(int(min(DownloadThread.maxRequestChunk, len(missingObjects)) / len(connections)), 1) except ZeroDivisionError: requestChunk = 1 for i in connections: