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

Fix "RuntimeError: generator raised StopIteration" #16

Closed
wants to merge 1 commit into from

Conversation

fujimotos
Copy link

Fix #14.

Since Python 3.7, raising StopIteration within a generator
causes RuntimeError. This breaking behaviour was introduced
by PEP-479:

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

For this reason, TransportStreamFile iterator always ends
up causing an unhandled exception. Fix it by replacing
raise StopIteration with a simple return statement.

Signed-off-by: Fujimoto Seiji fujimoto@ceptord.net

Since Python 3.7, raising StopIteration within a generator
causes RuntimeError. This breaking behaviour was introduced
by PEP-479:

> https://peps.python.org/pep-0479/

For this reason, TransportStreamFile iterator always ends
up causing an unhandled exception. Fix it by replacing
`raise StopIteration` with a simple return statement.

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
@fujimotos fujimotos closed this Jun 16, 2022
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 this pull request may close these issues.

Python 3.7でRuntimeError: generator raised StopIteration 
1 participant