Skip to content

Commit

Permalink
mypy: apply same for tar to targz
Browse files Browse the repository at this point in the history
Signed-off-by: tarilabs <[email protected]>
  • Loading branch information
tarilabs committed Dec 17, 2024
1 parent 690de97 commit 01999d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions olot/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def targz_into_ocilayout(ocilayout: Path, model: Path):
temp_tar_filename = sha256_path / "temp_layer"
with open(temp_tar_filename, "wb") as temp_file:
writer = HashingWriter(temp_file)
with gzip.GzipFile(fileobj=writer, mode="wb", mtime=0, compresslevel=6) as gz:
with gzip.GzipFile(fileobj=writer, mode="wb", mtime=0, compresslevel=6) as gz: # type:ignore
inner_writer = HashingWriter(gz)
with tarfile.open(fileobj=inner_writer, mode="w") as tar:
with tarfile.open(fileobj=inner_writer, mode="w") as tar: # type:ignore
tar.add(model, arcname="/models/"+model.name, filter=tar_filter_fn)
checksum = writer.hash_func.hexdigest()
tar_checksum = inner_writer.hash_func.hexdigest()
Expand Down

0 comments on commit 01999d0

Please sign in to comment.