Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions gridfs/asynchronous/grid_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,11 +1301,8 @@ async def write(self, data: Any) -> None:
raise ValueError("cannot write to a closed file")

try:
if isinstance(data, AsyncGridOut):
read = data.read
else:
# file-like
read = data.read
# file-like
read = data.read
except AttributeError:
# string
if not isinstance(data, (str, bytes)):
Expand Down
7 changes: 2 additions & 5 deletions gridfs/synchronous/grid_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,11 +1291,8 @@ def write(self, data: Any) -> None:
raise ValueError("cannot write to a closed file")

try:
if isinstance(data, GridOut):
read = data.read
else:
# file-like
read = data.read
# file-like
read = data.read
except AttributeError:
# string
if not isinstance(data, (str, bytes)):
Expand Down
Loading