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