Skip to content

Commit

Permalink
Merge pull request #208 from cpcloud/close-files-in-pin-download
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelizimm authored Aug 15, 2023
2 parents a4aecfc + 0992978 commit 917ca3a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pins/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,17 +388,16 @@ def pin_download(self, name, version=None, hash=None) -> Sequence[str]:

# TODO: raise for multiple files
# fetch file
f = load_file(
with load_file(
meta, self.fs, self.construct_path([pin_name, meta.version.version])
)
) as f:
# could also check whether f isinstance of PinCache
fname = getattr(f, "name", None)

# could also check whether f isinstance of PinCache
fname = getattr(f, "name", None)
if fname is None:
raise PinsError("pin_download requires a cache.")

if fname is None:
raise PinsError("pin_download requires a cache.")

return [str(Path(fname).absolute())]
return [str(Path(fname).absolute())]

def pin_upload(
self,
Expand Down

0 comments on commit 917ca3a

Please sign in to comment.