#NEWLINE# def test_is_enabled( self ) : #NEWLINE# #INDENT# orig_stderr = sys . stderr #NEWLINE# try : #NEWLINE# #INDENT# sys . stderr = sys . __stderr__ #NEWLINE# was_enabled = faulthandler . is_enabled ( ) #NEWLINE# try : #NEWLINE# #INDENT# faulthandler . enable ( ) #NEWLINE# self . assertTrue ( faulthandler . is_enabled ( ) ) #NEWLINE# faulthandler . disable ( ) #NEWLINE# self . assertFalse ( faulthandler . is_enabled ( ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# if was_enabled : #NEWLINE# #INDENT# faulthandler . enable ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# faulthandler . disable ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# sys . stderr = orig_stderr