#NEWLINE# def _print_exception( e , indent = '' ) : #NEWLINE# #INDENT# '\n    Used for debugging to print out nested exception structures.\n    ' #NEWLINE# print ( ( indent + 'EXCEPTION' ) , repr ( e ) ) #NEWLINE# print ( ( indent + 'CLASS' ) , type ( e ) ) #NEWLINE# for ( i , a ) in enumerate ( indent . args ) : #NEWLINE# #INDENT# print ( ( indent + ( 'ARG %d: %s' % ( i , repr ( a ) ) ) ) ) #NEWLINE# if isinstance ( a , Exception ) : #NEWLINE# #INDENT# _print_exception ( a , ( indent + '        ' ) )