Skip to content

Commit

Permalink
Newer mypy version arose a condition where calling hexDigest could no…
Browse files Browse the repository at this point in the history
…t be safe
  • Loading branch information
jmfernandez committed Feb 18, 2025
1 parent 61d7ddb commit 115f9a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wfexs_backend/ro_crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ def _add_containers(
the_size = os.stat(container.localPath).st_size
if container.image_signature is not None:
digest, algo = extract_digest(container.image_signature)
if digest is None:
if digest is None or digest == False:
digest, algo = unstringifyDigest(container.image_signature)
assert algo is not None
the_signature = hexDigest(algo, digest)
Expand Down Expand Up @@ -1561,7 +1561,7 @@ def addWorkflowInputs(
the_signature: "Optional[Fingerprint]" = None
if itemInValues.fingerprint is not None:
digest, algo = extract_digest(itemInValues.fingerprint)
if digest is not None:
if digest is not None and digest != False:
assert algo is not None
the_signature = hexDigest(algo, digest)

Expand Down Expand Up @@ -1796,7 +1796,7 @@ def addWorkflowInputs(
sec_digest, sec_algo = extract_digest(
secInput.fingerprint
)
if sec_digest is not None:
if sec_digest is not None and sec_digest != False:
assert sec_algo is not None
the_sec_signature = hexDigest(
sec_algo, sec_digest
Expand Down Expand Up @@ -2977,7 +2977,7 @@ def _add_GeneratedContent_to_crate(
assert the_content.signature is not None

digest, algo = extract_digest(the_content.signature)
if digest is None:
if digest is None or digest == False:
digest, algo = unstringifyDigest(the_content.signature)
assert algo is not None
dest_path = os.path.relpath(the_content.local, self.work_dir)
Expand Down

0 comments on commit 115f9a5

Please sign in to comment.