Commits

Michał Górny committed a39d818

Portage: don't use dbapi.repositories[], for 2.1.10.3.

Comments (0)

Files changed (1)

gentoopm/portagepm/repo.py

 				repo_name = self._dbapi.repositories.get_name_for_location(key)
 			else:
 				repo_name = key
-			r = self._dbapi.repositories[repo_name]
+			try:
+				r = self._dbapi.repositories[repo_name]
+			except TypeError: # older portage doesn't have __getitem__() here
+				for r in self._dbapi.repositories:
+					if r.name == repo_name:
+						break
+				else:
+					raise KeyError(repo_name)
 		except KeyError:
 			raise KeyError('No repository matched key %s' % key)
 		else: