Code Quality #2187

Merged
anand-skss merged 1 commits from code-quality into v0.6 2024-02-29 04:26:41 +01:00
3 changed files with 6 additions and 6 deletions

View File

@ -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()

View File

@ -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',

View File

@ -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)