From d692c56e2bb94ccbfae16c42212a4fe10b3223be Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 29 Oct 2006 22:25:50 +0000 Subject: [PATCH] For bug #153295, do a sanity check for non-string types in config.environ(). svn path=/main/trunk/; revision=4877 --- pym/portage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"][:] -- 2.26.2