def get_ignored_traceback(tb):
 tb_list = []
 while tb:
  tb_list.append(tb)
  tb = tb.tb_next
 ignored_tracebacks = []
 for tb in reversed(tb_list):
  if ('__unittest' in tb.tb_frame.f_globals):
   ignored_tracebacks.append(tb)
  else:
   break
 if ignored_tracebacks:
  return ignored_tracebacks[(-1)]

def get_ignored_traceback ( tb ) : tb_list = [ ] while tb : tb_list . append ( tb ) tb = tb . tb_next ignored_tracebacks = [ ] for tb in reversed ( tb_list ) : if ( '__unittest' in tb . tb_frame . f_globals ) : ignored_tracebacks . append ( tb ) else : break if ignored_tracebacks : return ignored_tracebacks [ ( - 1 ) ]
retrieve the first traceback of an ignored trailing chain .