From: Zac Medico Date: Fri, 20 Aug 2010 22:32:13 +0000 (-0700) Subject: Make varexpand() create a new empty dict for variable expansions in X-Git-Tag: v2.2_rc68~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5bb4ab9957ada3eb044c1d3a740930aa8fd67833;p=portage.git Make varexpand() create a new empty dict for variable expansions in case one is not passed in. This will prevent some potentially confusing behavior. --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 8b110f8a8..b5ae524b0 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -498,7 +498,9 @@ def getconfig(mycfg, tolerant=0, allow_sourcing=False, expand=True): #cache expansions of constant strings cexpand={} -def varexpand(mystring, mydict={}): +def varexpand(mystring, mydict=None): + if mydict is None: + mydict = {} newstring = cexpand.get(" "+mystring, None) if newstring is not None: return newstring