def print_stack():
 import traceback
 with open(DUMP_FILENAME, 'ab') as dump_file:
  traceback.print_stack(file=dump_file)

def print_stack ( ) : import traceback with open ( DUMP_FILENAME , 'ab' ) as dump_file : traceback . print_stack ( file = dump_file )
dump a stack trace into the debug file .