From 338d1cc53b5ccd692392b7b04ae99d070ecdd4b2 Mon Sep 17 00:00:00 2001 From: Sylvain Boissel Date: Mon, 23 Oct 2023 21:15:03 +0200 Subject: [PATCH] Remove useless check --- dsfr/management/commands/integrity_checksums.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dsfr/management/commands/integrity_checksums.py b/dsfr/management/commands/integrity_checksums.py index fc9b54bfe..53b27347a 100644 --- a/dsfr/management/commands/integrity_checksums.py +++ b/dsfr/management/commands/integrity_checksums.py @@ -49,10 +49,7 @@ def handle(self, *args, **options): with open("dsfr/constants.py", "w") as output_file: output_file.write(output_text) - def calculate_checksum(self, input_content): - if isinstance(input_content, str): - input_content = input_content.encode() - + def calculate_checksum(self, input_content: bytes): hashed_content = hashlib.sha384(input_content).digest() hash_base64 = base64.b64encode(hashed_content).decode() return "sha384-{}".format(hash_base64)