def get_raising_file_and_line(tb=None):
 if (not tb):
  tb = sys.exc_info()[2]
 (filename, lineno, _context, _line) = traceback.extract_tb(tb)[(-1)]
 return (filename, lineno)

def get_raising_file_and_line ( tb = None ) : if ( not tb ) : tb = sys . exc_info ( ) [ 2 ] ( filename , lineno , _context , _line ) = traceback . extract_tb ( tb ) [ ( - 1 ) ] return ( filename , lineno )
return the file and line number of the statement that raised the tb .