Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.7でRuntimeError: generator raised StopIteration  #14

Open
xswqaz opened this issue Sep 21, 2019 · 0 comments
Open

Python 3.7でRuntimeError: generator raised StopIteration  #14

xswqaz opened this issue Sep 21, 2019 · 0 comments

Comments

@xswqaz
Copy link

xswqaz commented Sep 21, 2019

https://www.python.org/dev/peps/pep-0479/

ariblib/packet.py

    def __iter__(self):
        packet_size = self.PACKET_SIZE
        chunk_size = self.chunk_size
        buffer_size = packet_size * chunk_size
        packets = iter(lambda: self.read(buffer_size), b'')
        for packet in packets:
            for start, stop in zip(
                range(0, buffer_size - packet_size + 1, packet_size),
                range(packet_size, buffer_size + 1, packet_size)
            ):
                next = packet[start:stop]
                if not next:
                    raise StopIteration  <---
                yield next
@xswqaz xswqaz changed the title Pyrhon 3.7でRuntimeError: generator raised StopIteration  Python 3.7でRuntimeError: generator raised StopIteration  Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant