#NEWLINE# def GetStack( ) : #NEWLINE# #INDENT# trc = 'Traceback (most recent call last):\n' #NEWLINE# stackstr = ( ( ( trc + '' . join ( traceback . format_list ( traceback . extract_stack ( ) [ : ( - 2 ) ] ) ) ) + '  ' ) + traceback . format_exc ( ) . lstrip ( trc ) ) #NEWLINE# return stackstr