Skip to content

Commit

Permalink
tc_build: source: Use an identifier for magic number
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Mar 17, 2023
1 parent 4fd6541 commit 01b65b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tc_build/source.py
Expand Up @@ -10,6 +10,9 @@
except ModuleNotFoundError:
from . import utils

# When doing verification, read 128MiB at a time
BYTES_TO_READ = 131072


class Tarball:

Expand Down Expand Up @@ -50,7 +53,7 @@ def download(self):
raise RuntimeError(
f"No supported hashlib for {self.remote_checksum_name}, add support for it?")
with self.local_location.open('rb') as file:
while (data := file.read(131072)):
while (data := file.read(BYTES_TO_READ)):
file_hash.update(data)

computed_checksum = file_hash.hexdigest()
Expand Down

0 comments on commit 01b65b9

Please sign in to comment.