From c734ac7b5faa8ecbaebf8532c159f649abd92a91 Mon Sep 17 00:00:00 2001 From: anand-skss <160696255+anand-skss@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:10:33 +0000 Subject: [PATCH] Code Quality --- src/bitmessagekivy/identiconGeneration.py | 2 +- src/class_singleWorker.py | 4 ++-- src/network/bmproto.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bitmessagekivy/identiconGeneration.py b/src/bitmessagekivy/identiconGeneration.py index 52042602..8f129185 100644 --- a/src/bitmessagekivy/identiconGeneration.py +++ b/src/bitmessagekivy/identiconGeneration.py @@ -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() diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index b65f44c8..ff9c0492 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -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', diff --git a/src/network/bmproto.py b/src/network/bmproto.py index 99e66965..5af71845 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -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) -- 2.45.1