#NEWLINE# @ contextmanager #NEWLINE# def update( self ) : #NEWLINE# #INDENT# 'Opens the artifact for modifications.  At the start the dirty\n        flag is cleared out and if the commit goes through without errors it\n        stays cleared.  The setting of the dirty flag has to be done by the\n        caller however based on the `exc_info` on the context.\n        ' #NEWLINE# ctx = self . begin_update ( ) #NEWLINE# try : #NEWLINE# #INDENT# ( yield exc_info ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# exc_info = sys . exc_info ( ) #NEWLINE# self . finish_update ( ctx , exc_info ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . finish_update ( ctx )