bintree/portree: fix getslot for EAPI 5 sub-slot
authorZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 03:32:20 +0000 (20:32 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 18 Oct 2012 03:32:20 +0000 (20:32 -0700)
pym/portage/dbapi/bintree.py
pym/portage/dbapi/porttree.py

index cbcfa728f6936f9ffa5c1eae587bb949802a7717..f90a4936f27ed4bfc9ba35e01f1c1a1947ac56dd 100644 (file)
@@ -1484,9 +1484,7 @@ class binarytree(object):
                "Get a slot for a catpkg; assume it exists."
                myslot = ""
                try:
-                       myslot = self.dbapi.aux_get(mycatpkg,["SLOT"])[0]
-               except SystemExit as e:
-                       raise
-               except Exception as e:
+                       myslot = self.dbapi._pkg_str(mycatpkg, None).slot
+               except KeyError:
                        pass
                return myslot
index a5945be59da97c9a70e0e7d20684815cdf3ef953..115fc7f298cff680f9ad091f89a8f825bb554a42 100644 (file)
@@ -1063,10 +1063,8 @@ class portagetree(object):
                "Get a slot for a catpkg; assume it exists."
                myslot = ""
                try:
-                       myslot = self.dbapi.aux_get(mycatpkg, ["SLOT"])[0]
-               except SystemExit:
-                       raise
-               except Exception:
+                       myslot = self.dbapi._pkg_str(mycatpkg, None).slot
+               except KeyError:
                        pass
                return myslot