From 2cb95eb8c68a692b0abb535925e8b55175285ea4 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 29 Dec 2021 15:04:35 +0100 Subject: don't return the first parameter from hash_file Returning the object gets us into trouble as to what precisely the return type is at no benefit. --- dedup/debpkg.py | 2 +- dedup/hashing.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'dedup') diff --git a/dedup/debpkg.py b/dedup/debpkg.py index 0ecb123..de00e60 100644 --- a/dedup/debpkg.py +++ b/dedup/debpkg.py @@ -29,7 +29,7 @@ def get_tar_hashes(tar, hash_functions): if not elem.isreg(): # excludes hard links as well continue hasher = MultiHash(*[func() for func in hash_functions]) - hasher = hash_file(hasher, tar.extractfile(elem)) + hash_file(hasher, tar.extractfile(elem)) hashes = {} for hashobj in hasher.hashes: hashvalue = hashobj.hexdigest() diff --git a/dedup/hashing.py b/dedup/hashing.py index 21f14ea..27f303c 100644 --- a/dedup/hashing.py +++ b/dedup/hashing.py @@ -161,7 +161,6 @@ def hash_file(hashobj, filelike, blocksize=65536): while data: hashobj.update(data) data = filelike.read(blocksize) - return hashobj class HashedStream: """A file-like object, that supports sequential reading and hashes the -- cgit v1.2.3