summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-20 15:32:13 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-20 15:32:13 -0700
commit5bb4ab9957ada3eb044c1d3a740930aa8fd67833 (patch)
treec15aa65e64deed2d3d54ef883794f971f9a455e9
parent02a458b4e9d09dcbf8b2f937fe49f18bf0d3e628 (diff)
downloadportage-5bb4ab9957ada3eb044c1d3a740930aa8fd67833.tar.gz
portage-5bb4ab9957ada3eb044c1d3a740930aa8fd67833.tar.bz2
portage-5bb4ab9957ada3eb044c1d3a740930aa8fd67833.zip
Make varexpand() create a new empty dict for variable expansions in
case one is not passed in. This will prevent some potentially confusing behavior.
-rw-r--r--pym/portage/util/__init__.py4
1 files changed, 3 insertions, 1 deletions
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