Skip to content

Commit cb0ede9

Browse files
committed
catch StopAsyncIteration
1 parent ad7712e commit cb0ede9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gridfs/asynchronous/grid_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ async def get_version(
231231
try:
232232
doc = await anext(cursor)
233233
return AsyncGridOut(self._collection, file_document=doc, session=session)
234-
except StopIteration:
234+
except (StopIteration, StopAsyncIteration):
235235
raise NoFile("no version %d for filename %r" % (version, filename)) from None
236236

237237
async def get_last_version(

0 commit comments

Comments
 (0)