Skip to content

Commit

Permalink
verify if provided object has seekable function when verifying if its…
Browse files Browse the repository at this point in the history
… empty
  • Loading branch information
kathia-barahona authored and rdunklau committed Nov 29, 2023
1 parent f3b1f53 commit cc2b427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rohmu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def set_stream_nonblocking(stream: HasFileno) -> None:

def file_object_is_empty(fd: BinaryIO) -> bool:
# not seekable, so we cannot verify it has no contents
if not fd.seekable():
if not hasattr(fd, "seekable") or not fd.seekable():
return False

fd.seek(0)
Expand Down

0 comments on commit cc2b427

Please sign in to comment.