From b12a4b5707b578da014e6f8d88a025c98a1530a8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 7 Nov 2009 01:09:57 +0000 Subject: Don't call FakeVartree.sync() redundantly when backtracking. (trunk r14774) svn path=/main/branches/2.1.7/; revision=14787 --- pym/_emerge/PackageVirtualDbapi.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pym/_emerge/PackageVirtualDbapi.py') diff --git a/pym/_emerge/PackageVirtualDbapi.py b/pym/_emerge/PackageVirtualDbapi.py index adf269116..e557f0489 100644 --- a/pym/_emerge/PackageVirtualDbapi.py +++ b/pym/_emerge/PackageVirtualDbapi.py @@ -2,6 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys import portage class PackageVirtualDbapi(portage.dbapi): @@ -37,6 +38,12 @@ class PackageVirtualDbapi(portage.dbapi): obj._cpv_map = self._cpv_map.copy() return obj + def __bool__(self): + return bool(self._cpv_map) + + if sys.hexversion < 0x3000000: + __nonzero__ = __bool__ + def __iter__(self): return iter(self._cpv_map.values()) -- cgit v1.2.3-1-g7c22