Added iteritems issues

This commit is contained in:
jai.s 2019-11-15 20:12:19 +05:30
parent a08b0707bb
commit 0e593b66ad
No known key found for this signature in database
GPG Key ID: 360CFA25EFC67D12

View File

@ -105,14 +105,13 @@ class Dandelion(): # pylint: disable=old-style-class
#hashMap is has any value
# if not [hasmap for hasmap in self.hashMap.items()] ==[]:
try:
if self.hashMap:
for k, v in iter({
k: v for k, v in iter([hasmap for hasmap in self.hashMap.items()])
if v.child is None
}).items():
self.hashMap[k] = Stem(
connection, v.stream, self.poissonTimeout())
invQueue.put((v.stream, k, v.child))
for k, v in {
k: v for k, v in iter([hasmap for hasmap in self.hashMap.items()])
if v.child is None
}.items():
self.hashMap[k] = Stem(
connection, v.stream, self.poissonTimeout())
invQueue.put((v.stream, k, v.child))
except AttributeError:
pass
@ -139,10 +138,10 @@ class Dandelion(): # pylint: disable=old-style-class
k for k, v in iter(self.nodeMap.items()) if v == connection
):
self.nodeMap[k] = None
for k, v in iter({
for k, v in {
k: v for k, v in iter(iter([hasmap for hasmap in self.hashMap.items()]))
if v.child == connection
}).items():
}.items():
self.hashMap[k] = Stem(
None, v.stream, self.poissonTimeout())