Skip to content

Commit 397ea6b

Browse files
committed
Cleanup
1 parent 54d333a commit 397ea6b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

gridfs/asynchronous/grid_file.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,10 +1489,11 @@ def __init__(
14891489
async def __anext__(self) -> bytes:
14901490
return super().__next__()
14911491

1492-
def __next__(self) -> bytes: # noqa: F811, RUF100
1493-
if _IS_SYNC:
1494-
return super().__next__()
1495-
else:
1492+
# This is a duplicate definition of __next__ for the synchronous API
1493+
# due to the limitations of our synchro process
1494+
if not _IS_SYNC:
1495+
1496+
def __next__(self) -> bytes: # noqa: F811, RUF100
14961497
raise TypeError(
14971498
"AsyncGridOut does not support synchronous iteration. Use `async for` instead"
14981499
)

gridfs/synchronous/grid_file.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,10 +1477,11 @@ def __init__(
14771477
def __next__(self) -> bytes:
14781478
return super().__next__()
14791479

1480-
def __next__(self) -> bytes: # noqa: F811, RUF100
1481-
if _IS_SYNC:
1482-
return super().__next__()
1483-
else:
1480+
# This is a duplicate definition of __next__ for the synchronous API
1481+
# due to the limitations of our synchro process
1482+
if not _IS_SYNC:
1483+
1484+
def __next__(self) -> bytes: # noqa: F811, RUF100
14841485
raise TypeError("GridOut does not support synchronous iteration. Use `for` instead")
14851486

14861487
def open(self) -> None:

0 commit comments

Comments
 (0)