Code Quality
This commit is contained in:
parent
b8e099539e
commit
c734ac7b5f
|
@ -40,7 +40,7 @@ def generate_hash(string):
|
|||
try:
|
||||
# make input case insensitive
|
||||
string = str.lower(string)
|
||||
hash_object = hashlib.md5(str.encode(string)) # nosec B303
|
||||
hash_object = hashlib.md5(str.encode(string)) # nosec B303, B324
|
||||
print(hash_object.hexdigest())
|
||||
# returned object is a hex string
|
||||
return hash_object.hexdigest()
|
||||
|
|
|
@ -521,8 +521,8 @@ class singleWorker(StoppableThread):
|
|||
|
||||
inventoryHash = calculateInventoryHash(payload)
|
||||
Inventory()[inventoryHash] = (
|
||||
objectType, streamNumber, buffer(payload),
|
||||
embeddedTime, buffer(tag)
|
||||
objectType, streamNumber, buffer(payload), # noqa: F821
|
||||
embeddedTime, buffer(tag) # noqa: F821
|
||||
)
|
||||
self.logger.info(
|
||||
'sending inv (within sendOnionPeerObj function) for object: %s',
|
||||
|
|
|
@ -413,7 +413,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
|
|||
try:
|
||||
self.object.checkObjectByType()
|
||||
objectProcessorQueue.put((
|
||||
self.object.objectType, buffer(self.object.data)))
|
||||
self.object.objectType, buffer(self.object.data))) # noqa: F821
|
||||
except BMObjectInvalidError:
|
||||
BMProto.stopDownloadingObject(self.object.inventoryHash, True)
|
||||
else:
|
||||
|
@ -429,8 +429,8 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
|
|||
|
||||
Inventory()[self.object.inventoryHash] = (
|
||||
self.object.objectType, self.object.streamNumber,
|
||||
buffer(self.payload[objectOffset:]), self.object.expiresTime,
|
||||
buffer(self.object.tag)
|
||||
buffer(self.payload[objectOffset:]), self.object.expiresTime, # noqa: F821
|
||||
buffer(self.object.tag) # noqa: F821
|
||||
)
|
||||
self.handleReceivedObject(
|
||||
self.object.streamNumber, self.object.inventoryHash)
|
||||
|
|
Reference in New Issue
Block a user