Commits

Michał Górny committed 3b865a3

Fix compatibility with PyPy.

It seems that exception arguments are held differently for some reason.

  • Participants
  • Parent commits 338e65d

Comments (0)

Files changed (1)

File gentoopm/portagepm/repo.py

 		try:
 			it = self._dbapi.xmatch("match-all", a)
 		except pe.AmbiguousPackageName as e:
-			for pkgcand in e.args[0]:
+			try:
+				candidates = e.args[0]
+			except IndexError: # pypy?
+				candidates = e.value
+
+			for pkgcand in candidates:
 				for p in PortageHackedFilteredRepo(self, pkgcand):
 					yield p
 		else: