def extract_tb(tb, limit=None):
 if (limit is None):
  if hasattr(sys, 'tracebacklimit'):
   limit = sys.tracebacklimit
 list = []
 n = 0
 while ((tb is not None) and ((limit is None) or (n < limit))):
  f = tb.tb_frame
  lineno = tb.tb_lineno
  co = f.f_code
  filename = co.co_filename
  name = co.co_name
  linecache.checkcache(filename)
  line = linecache.getline(filename, lineno, f.f_globals)
  if line:
   line = line.strip()
  else:
   line = None
  list.append((filename, lineno, name, line))
  tb = tb.tb_next
  n = (n + 1)
 return list

def extract_tb ( tb , limit = None ) : if ( limit is None ) : if hasattr ( sys , 'tracebacklimit' ) : limit = sys . tracebacklimit list = [ ] n = 0 while ( ( tb is not None ) and ( ( limit is None ) or ( n < limit ) ) ) : f = tb . tb_frame lineno = tb . tb_lineno co = f . f_code filename = co . co_filename name = co . co_name linecache . checkcache ( filename ) line = linecache . getline ( filename , lineno , f . f_globals ) if line : line = line . strip ( ) else : line = None list . append ( ( filename , lineno , name , line ) ) tb = tb . tb_next n = ( n + 1 ) return list
return list of up to limit pre-processed entries from traceback .