From 4dc0fe373246e2b593f4ce8858bead44d6cc3434 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 2 Oct 2006 22:39:03 +0000 Subject: [PATCH] Optimize varexpand for bug #149900. svn path=/main/trunk/; revision=4574 --- pym/portage_util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pym/portage_util.py b/pym/portage_util.py index 83cdeda50..9d1bb84c2 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -286,10 +286,10 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False): #cache expansions of constant strings cexpand={} def varexpand(mystring,mydict={}): - try: - return cexpand[" "+mystring] - except KeyError: - pass + newstring = cexpand.get(" "+mystring, None) + if newstring is not None: + return newstring + """ new variable expansion code. Removes quotes, handles \n, etc. This code is used by the configfile code, as well as others (parser) -- 2.26.2