From 020a78b7765e307630c97e08ec4e9e81cd8b4ca0 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 1 Nov 2016 14:44:39 +0100 Subject: [PATCH] Exception prevention in hashCount - I got a report that an exception can occur, and while I can't reproduce it, this should avoid it --- src/class_objectHashHolder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class_objectHashHolder.py b/src/class_objectHashHolder.py index 3fc260d2..30d27ea8 100644 --- a/src/class_objectHashHolder.py +++ b/src/class_objectHashHolder.py @@ -49,7 +49,7 @@ class objectHashHolder(threading.Thread): self.collectionOfPeerLists[random.randrange(0, self.size)].append(peerDetails) def hashCount(self): - return sum([len(x) for x in self.collectionOfHashLists]) + return sum([len(x) for x in self.collectionOfHashLists if type(x) is list]) def close(self): self.shutdown = True