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 / PEP 479 compliance fix for iterator nestedly raising StopIteration #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csachs
Copy link

@csachs csachs commented Apr 17, 2019

peekiter() raises StopIteration from within a nested generator, this behavior was soft deprecated in Python 3.6 and hard deprecated in Python 3.7. (I found out because some code broke ;))

Fixes the following DeprecationWarning in Python 3.6:

python test_png.py 
...................purepng/png/png.py:1480: DeprecationWarning: generator 'peekiter.<locals>.gen' raised StopIteration
  for i, row in enumrows:
.........................................................purepng/png/png.py:1318: DeprecationWarning: generator 'peekiter.<locals>.gen' raised StopIteration
  for row in inrows:
.......
----------------------------------------------------------------------
Ran 83 tests in 3.169s

OK

And a uncaught exception in Python 3.7…

Fix iterator nestedly raising StopIteration
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.

1 participant