summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-29 22:25:50 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-29 22:25:50 +0000
commitd692c56e2bb94ccbfae16c42212a4fe10b3223be (patch)
tree5a740cece076cac63779db92ddc96e325484d8b6
parent956076174104dd8162f788f765591eb1e74e60ab (diff)
downloadportage-d692c56e2bb94ccbfae16c42212a4fe10b3223be.tar.gz
portage-d692c56e2bb94ccbfae16c42212a4fe10b3223be.tar.bz2
portage-d692c56e2bb94ccbfae16c42212a4fe10b3223be.zip
For bug #153295, do a sanity check for non-string types in config.environ().
svn path=/main/trunk/; revision=4877
-rw-r--r--pym/portage.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 70671b593..f527ad826 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1910,7 +1910,12 @@ class config:
"return our locally-maintained environment"
mydict={}
for x in self.keys():
- mydict[x]=self[x]
+ myvalue = self[x]
+ if not isinstance(myvalue, basestring):
+ writemsg("!!! Non-string value in config: %s=%s\n" % \
+ (x, myvalue), noiselevel=-1)
+ continue
+ mydict[x] = myvalue
if not mydict.has_key("HOME") and mydict.has_key("BUILD_PREFIX"):
writemsg("*** HOME not set. Setting to "+mydict["BUILD_PREFIX"]+"\n")
mydict["HOME"]=mydict["BUILD_PREFIX"][:]