Remove a redundant os.access() call in portdbapi.aux_get()
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Oct 2007 06:23:04 +0000 (06:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Oct 2007 06:23:04 +0000 (06:23 -0000)
and handle the potential OSError instead. (trunk r8009)

svn path=/main/branches/2.1.2/; revision=8067

pym/portage.py

index 8afd051ca62609ec21111249d93eddb08460553b..3edc5296a2b8e0581d886803af09a2bc861fe682 100644 (file)
@@ -6253,14 +6253,14 @@ class portdbapi(dbapi):
                                        noiselevel=-1)
 
 
-               if os.access(myebuild, os.R_OK):
+               try:
                        emtime=os.stat(myebuild)[stat.ST_MTIME]
-               else:
+               except OSError:
                        writemsg("!!! aux_get(): ebuild for '%(cpv)s' does not exist at:\n" % {"cpv":mycpv},
                                noiselevel=-1)
                        writemsg("!!!            %s\n" % myebuild,
                                noiselevel=-1)
-                       raise KeyError
+                       raise KeyError(mycpv)
 
                try:
                        mydata = self.auxdb[mylocation][mycpv]