#NEWLINE# def __exit__( self , exc_type , exc_val , exc_tb ) : #NEWLINE# #INDENT# 'Ends context manager and calls finish() on the span.\n\n        If exception has occurred during execution, it is automatically added\n        as a tag to the span.\n        ' #NEWLINE# if exc_type : #NEWLINE# #INDENT# self . log_event ( 'python.exception' , { #NEWLINE# #INDENT# 'type' : exc_type , #NEWLINE# 'val' : exc_type , #NEWLINE# 'tb' : exc_tb , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# self . finish ( )