# __COPYRIGHT__## Functions and data for timing different idioms for fetching a keyword# value from a pair of dictionaries for localand global values. This was# used to select how to most efficiently expand single $KEYWORD strings# in src/engine/SCons/Subst.py.defFunc1(var,gvars,lvars):"""lvars try:-except:, gvars try:-except:"""foriinIterationList:try:x=lvars[var]exceptKeyError:try:x=gvars[var]exceptKeyError:x=''defFunc2(var,gvars,lvars):"""lvars has_key(), gvars try:-except:"""foriinIterationList:iflvars.has_key(var):x=lvars[var]else:try:x=gvars[var]exceptKeyError:x=''defFunc3(var,gvars,lvars):"""lvars has_key(), gvars has_key()"""foriinIterationList:iflvars.has_key(var):x=lvars[var]elifgvars.has_key(var):x=gvars[var]else:x=''defFunc4(var,gvars,lvars):"""eval()"""foriinIterationList:try:x=eval(var,gvars,lvars)exceptNameError:x=''# Data to pass to the functions on each run. Each entry is a# three-element tuple:## (# "Label to print describing this data run",# ('positional', 'arguments'),# {'keyword' : 'arguments'},# ),Data=[("Neither in gvars or lvars",('x',{},{}),{},),("Missing from lvars, found in gvars",('x',{'x':1},{}),{},),("Found in lvars",('x',{'x':1},{'x':2}),{},),]