Closed kipyin closed 5 years ago
I must be on drugs to yield StopIteration
...
So it seems like it is a Python 3.7 specific issue. What I was getting was:
RuntimeError: generator raised StopIteration
So I think catching StopIteration
and have an empty return for Python 3.7+ should solve this issue.
Thanks!
In the following code:
https://github.com/veekun/pokedex/blob/18925edcd3ad71dd912a94ce4b1bc1435943937a/pokedex/db/translations.py#L374-L390
When
stream
is exhausted, operatingnext(stream)
will throwStopIteration
and the entire program will terminate. The expected behavior isyield StopIteration
and let the for loop handle the situation.