Skip to content

Commit

Permalink
fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson committed Jun 2, 2023
1 parent 68e5b56 commit 3e2ba47
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pdm/models/caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import contextlib
import dataclasses
import hashlib
import io
import json
import os
from functools import lru_cache
Expand Down Expand Up @@ -273,10 +272,12 @@ def get(self, key: str) -> bytes | None:

return None

def get_body(self, key) -> io.FileIO | None:
def get_body(self, key: str) -> BinaryIO | None:
path = self._get_cache_path(key)
with contextlib.suppress(OSError):
return open(f"{path}.body", "rb")
return cast(BinaryIO, open(f"{path}.body", "rb"))

return None

def set(self, key: str, value: bytes, expires: int | None = None) -> None:
path = self._get_cache_path(key)
Expand Down

0 comments on commit 3e2ba47

Please sign in to comment.