parameters: (filename)
docstring: Read suppressions from the given file and return them as a list
docstring_summary: Read suppressions from the given file and return them as a list
docstring_tokens: Read suppressions from the given file and return them as a list
function: def ReadSuppressionsFromFile(filename):
    """Read suppressions from the given file and return them as a list"""
    tool_to_parser = {
      "drmemory":  ReadDrMemorySuppressions,
      "memcheck":  ReadValgrindStyleSuppressions,
      "tsan":      ReadValgrindStyleSuppressions,
    }
    tool = FilenameToTool(filename)
    assert tool in tool_to_parser, (
        "unknown tool %s for filename %s" % (tool, filename))
    parse_func = tool_to_parser[tool]
  
    # Consider non-existent files to be empty.
    if not os.path.exists(filename):
      return []
  
    input_file = file(filename, 'r')
    try:
      return parse_func(input_file, filename)
    except SuppressionError:
      input_file.close()
      raise
function_tokens: def ReadSuppressionsFromFile ( filename ) : tool_to_parser = { "drmemory" : ReadDrMemorySuppressions , "memcheck" : ReadValgrindStyleSuppressions , "tsan" : ReadValgrindStyleSuppressions , } tool = FilenameToTool ( filename ) assert tool in tool_to_parser , ( "unknown tool %s for filename %s" % ( tool , filename ) ) parse_func = tool_to_parser [ tool ] # Consider non-existent files to be empty. if not os . path . exists ( filename ) : return [ ] input_file = file ( filename , 'r' ) try : return parse_func ( input_file , filename ) except SuppressionError : input_file . close ( ) raise