]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Change generator termination from StopIteration to return.
authorpgjones <philip.graham.jones@googlemail.com>
Fri, 30 Oct 2015 20:20:58 +0000 (20:20 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 30 Nov 2015 17:35:35 +0000 (12:35 -0500)
commit735fb9295433fb2d42e3e47949eb59a08fec6f90
treeb76c38d3ce7cc5ac5756bef4a9cf65d131b3d061
parent730aa2140c96459e4b96f21d7c36b234fff9f39d
Change generator termination from StopIteration to return.

From [PEP 479](https://www.python.org/dev/peps/pep-0479/) the correct way to
terminate a generator is to return (which implicitly raises StopIteration)
rather than raise StopIteration.

Without this change using sqlalchemy in python 3.5 or greater results in
these warnings
    PendingDeprecationWarning: generator '__iter__' raised StopIteration
which this commit should remove.

(cherry picked from commit 6ab120558078bdcbfbe06d2ca55bd7a0d417bbb4)
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/ext/associationproxy.py