]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure session.no_autoflush uses finally
authorplumSemPy <emin@berkekely.edu>
Wed, 4 Jan 2017 17:06:48 +0000 (12:06 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 4 Jan 2017 17:12:52 +0000 (12:12 -0500)
commitcd95d4a5b928a6bc4f07c988ba3791a0a63c8d15
tree327e48818ed5aef6d3d7c67ee441bfbd10dcd089
parenta030bc9f171f6692e08eb7604f29e4bc6d51a574
Ensure session.no_autoflush uses finally

The :attr:`.Session.no_autoflush` context manager now ensures that
the autoflush flag is reset within a "finally" block, so that if
an exception is raised within the block, the state still resets
appropriately.  Pull request courtesy Emin Arakelian.

Change-Id: Ib19ddf32074b1df82a6a1f1ae14e3a962cd31a5f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/335
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/orm/session.py
test/orm/test_session.py