Commits

Michał Górny committed 96b56b5

Support pkgcore-0.7.5+.

Comments (0)

Files changed (1)

gentoopm/pkgcorepm/repo.py

 from abc import abstractproperty
 
 import pkgcore.restrictions.boolean as br
+from pkgcore.ebuild.repository import UnconfiguredTree
 
 from ..basepm.repo import PMRepository, PMRepositoryDict, \
 		PMEbuildRepository
 
 class PkgCoreRepoDict(PMRepositoryDict):
 	def __iter__(self):
-		for i, r in enumerate(self._domain.named_repos['repo-stack'].trees):
+		try:
+			trees = self._domain.named_repos['repo-stack'].trees
+		except KeyError: # pkgcore-0.7.5+
+			def _match_ebuild_repos(x):
+				return isinstance(x, UnconfiguredTree)
+
+			trees = filter(_match_ebuild_repos,
+					self._domain.named_repos.values())
+
+		for i, r in enumerate(trees):
 			yield PkgCoreEbuildRepo(r, self._domain, i)
 
 	def __init__(self, domain):