#NEWLINE# @ contextmanager #NEWLINE# def _when_exits_zero( call_if_ok ) : #NEWLINE# #INDENT# '\n    Calls the function passed in if the SystemExit has a zero exit code.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# ( yield ) #NEWLINE# #UNINDENT# except SystemExit as se : #NEWLINE# #INDENT# if ( getattr ( se , 'code' , None ) == 0 ) : #NEWLINE# #INDENT# call_if_ok ( ) #NEWLINE# #UNINDENT# raise