Skip to content

Commit c3c76bf

Browse files
committed
Simplify LazyHTTPFile.get_data control flow
1 parent 82d14c1 commit c3c76bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

emails/store/file.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ def fetch(self) -> None:
190190
def get_data(self) -> bytes | str:
191191
self.fetch()
192192
data = self._data
193-
if data is None or isinstance(data, (str, bytes)):
194-
return data or ''
193+
if data is None:
194+
return ''
195+
if isinstance(data, (str, bytes)):
196+
return data
195197
return data.read()
196198

197199
def set_data(self, v: bytes | str | IO[bytes] | None) -> None:

0 commit comments

Comments
 (0)