def __exit__ ( self , * exc ) : if exc [ 0 ] is None and exc [ 1 ] is None and exc [ 2 ] is None : self . commit ( ) else : self . rollback ( )
python3 stop the current excutation
Exit the runtime context . This will end the transaction .
def __exit__(self, *exc):
        """Exit the runtime context. This will end the transaction."""
        if exc[0] is None and exc[1] is None and exc[2] is None:
            self.commit()
        else:
            self.rollback()