

@staticmethod
def _teardown_handler(session, app, session_options):
    'Static method to allow overriding without passing first argument.'
    try:
        if session_options['commit']:
            session.commit()
    except (DBAPIError, SQLAlchemyError) as err:
        if session_options['raise']:
            raise err
        session.rollback()
    finally:
        session.remove()

dataset/ETHPy150Open mtth/kit/kit/base.py Kit._teardown_handler/original