jorisvandenbossche commented on code in PR #36745:
URL: https://github.com/apache/arrow/pull/36745#discussion_r1269095137
##########
python/pyarrow/ipc.pxi:
##########
@@ -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
Review Comment:
I don't know if it is this code that gives problems to be written in a way
that works for both cython 0.29 and 3, but a potential different way of writing
it:
```
def __iter__(self):
return self
def __next__(self):
return self.read_next_message()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]