From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SCi2T-0000NU-Fi for garchives@archives.gentoo.org; Wed, 28 Mar 2012 01:51:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA025E088D; Wed, 28 Mar 2012 01:50:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8598AE088D for ; Wed, 28 Mar 2012 01:50:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8E2101B4014 for ; Wed, 28 Mar 2012 01:50:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 58A87E5402 for ; Wed, 28 Mar 2012 01:50:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1332899399.1f3d3626d0fb716f1566b0cafab738a8008d3881.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/__init__.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 1f3d3626d0fb716f1566b0cafab738a8008d3881 X-VCS-Branch: master Date: Wed, 28 Mar 2012 01:50:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a010c9fd-6bd5-4ea8-975f-758187356301 X-Archives-Hash: 2a6bd076d5886ac412641e4ae80f7380 commit: 1f3d3626d0fb716f1566b0cafab738a8008d3881 Author: Zac Medico gentoo org> AuthorDate: Wed Mar 28 01:49:59 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Mar 28 01:49:59 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D1f3d3626 varexpand: don't cache results Caching wasn't really necessary here, and it didn't properly account for input differences in the 'mydict' parameter. --- pym/portage/util/__init__.py | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index dd692a1..fc4b75b 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -645,15 +645,10 @@ def getconfig(mycfg, tolerant=3D0, allow_sourcing=3D= False, expand=3DTrue): except Exception as e: raise portage.exception.ParseError(str(e)+" in "+mycfg) return mykeys -=09 -#cache expansions of constant strings -cexpand=3D{} + def varexpand(mystring, mydict=3DNone): if mydict is None: mydict =3D {} - newstring =3D cexpand.get(" "+mystring, None) - if newstring is not None: - return newstring =20 """ new variable expansion code. Preserves quotes, handles \n, etc. @@ -666,7 +661,7 @@ def varexpand(mystring, mydict=3DNone): insing=3D0 indoub=3D0 pos=3D1 - newstring=3D" " + newstring =3D "" while (pos=3Dlen(mystring): if braced: - cexpand[mystring]=3D"" return "" else: pos=3Dpos+1 @@ -733,12 +727,10 @@ def varexpand(mystring, mydict=3DNone): myvarname=3Dmystring[myvstart:pos] if braced: if mystring[pos]!=3D"}": - cexpand[mystring]=3D"" return "" else: pos=3Dpos+1 if len(myvarname)=3D=3D0: - cexpand[mystring]=3D"" return "" numvars=3Dnumvars+1 if myvarname in mydict: @@ -749,9 +741,8 @@ def varexpand(mystring, mydict=3DNone): else: newstring=3Dnewstring+mystring[pos] pos=3Dpos+1 - if numvars=3D=3D0: - cexpand[mystring]=3Dnewstring[1:] - return newstring[1:]=09 + + return newstring =20 # broken and removed, but can still be imported pickle_write =3D None