data.py: grp/pwd struct attrs, not indexes
authorZac Medico <zmedico@gentoo.org>
Fri, 9 Dec 2011 23:23:16 +0000 (15:23 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 Dec 2011 23:23:16 +0000 (15:23 -0800)
pym/portage/data.py

index fa6970c42f198b587d796e83e38ff81e980f94f9..fe390a1304cfbcfa5d3129ceb223574f9a50d2d4 100644 (file)
@@ -86,8 +86,8 @@ def _get_global(k):
                        secpass = 2
                #Discover the uid and gid of the portage user/group
                try:
-                       portage_uid = pwd.getpwnam(_get_global('_portage_uname'))[2]
-                       portage_gid = grp.getgrnam(_get_global('_portage_grpname'))[2]
+                       portage_uid = pwd.getpwnam(_get_global('_portage_uname')).pw_uid
+                       portage_gid = grp.getgrnam(_get_global('_portage_grpname')).gr_gid
                        if secpass < 1 and portage_gid in os.getgroups():
                                secpass = 1
                except KeyError: