Skip to content

Commit

Permalink
Follow generator change
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 19, 2023
1 parent dba6bb4 commit 81493b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/pyarrow/ipc.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,11 @@ cdef class MessageReader(_Weakrefable):

def __iter__(self):
while True:
yield self.read_next_message()
try:
yield self.read_next_message()
except StopIteration:
# For Cython >= 3.0.0
return

def read_next_message(self):
"""
Expand Down Expand Up @@ -660,6 +664,7 @@ cdef class RecordBatchReader(_Weakrefable):
try:
yield self.read_next_batch()
except StopIteration:
# For Cython >= 3.0.0
return

@property
Expand Down

0 comments on commit 81493b1

Please sign in to comment.