parameters: (
      cond_expr, true_dict, false_dict, phase, variables, build_file)
docstring: Returns true_dict if cond_expr evaluates to true, and false_dict
    otherwise.
docstring_summary: Returns true_dict if cond_expr evaluates to true, and false_dict
    otherwise.
docstring_tokens: Returns true_dict if cond_expr evaluates to true and false_dict otherwise .
function: def EvalSingleCondition(
      cond_expr, true_dict, false_dict, phase, variables, build_file):
    """Returns true_dict if cond_expr evaluates to true, and false_dict
    otherwise."""
    # Do expansions on the condition itself.  Since the condition can naturally
    # contain variable references without needing to resort to GYP expansion
    # syntax, this is of dubious value for variables, but someone might want to
    # use a command expansion directly inside a condition.
    cond_expr_expanded = ExpandVariables(cond_expr, phase, variables,
                                         build_file)
    if type(cond_expr_expanded) not in (str, int):
      raise ValueError(
            'Variable expansion in this context permits str and int ' + \
              'only, found ' + cond_expr_expanded.__class__.__name__)
  
    try:
      if cond_expr_expanded in cached_conditions_asts:
        ast_code = cached_conditions_asts[cond_expr_expanded]
      else:
        ast_code = compile(cond_expr_expanded, '<string>', 'eval')
        cached_conditions_asts[cond_expr_expanded] = ast_code
      env = {'__builtins__': {}, 'v': StrictVersion}
      if eval(ast_code, env, variables):
        return true_dict
      return false_dict
    except SyntaxError as e:
      syntax_error = SyntaxError('%s while evaluating condition \'%s\' in %s '
                                 'at character %d.' %
                                 (str(e.args[0]), e.text, build_file, e.offset),
                                 e.filename, e.lineno, e.offset, e.text)
      raise syntax_error
    except NameError as e:
      gyp.common.ExceptionAppend(e, 'while evaluating condition \'%s\' in %s' %
                                 (cond_expr_expanded, build_file))
      raise GypError(e)
function_tokens: def EvalSingleCondition ( cond_expr , true_dict , false_dict , phase , variables , build_file ) : # Do expansions on the condition itself.  Since the condition can naturally # contain variable references without needing to resort to GYP expansion # syntax, this is of dubious value for variables, but someone might want to # use a command expansion directly inside a condition. cond_expr_expanded = ExpandVariables ( cond_expr , phase , variables , build_file ) if type ( cond_expr_expanded ) not in ( str , int ) : raise ValueError ( 'Variable expansion in this context permits str and int ' + 'only, found ' + cond_expr_expanded . __class__ . __name__ ) try : if cond_expr_expanded in cached_conditions_asts : ast_code = cached_conditions_asts [ cond_expr_expanded ] else : ast_code = compile ( cond_expr_expanded , '<string>' , 'eval' ) cached_conditions_asts [ cond_expr_expanded ] = ast_code env = { '__builtins__' : { } , 'v' : StrictVersion } if eval ( ast_code , env , variables ) : return true_dict return false_dict except SyntaxError as e : syntax_error = SyntaxError ( '%s while evaluating condition \'%s\' in %s ' 'at character %d.' % ( str ( e . args [ 0 ] ) , e . text , build_file , e . offset ) , e . filename , e . lineno , e . offset , e . text ) raise syntax_error except NameError as e : gyp . common . ExceptionAppend ( e , 'while evaluating condition \'%s\' in %s' % ( cond_expr_expanded , build_file ) ) raise GypError ( e )