From: Zac Medico Date: Thu, 7 Dec 2006 22:29:13 +0000 (-0000) Subject: Catch an exception instead of using a redundant os.access call. X-Git-Tag: v2.1.2~371 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=53f14db70339391fb13ca0adab353645f84be3f2;p=portage.git Catch an exception instead of using a redundant os.access call. svn path=/main/trunk/; revision=5209 --- diff --git a/pym/portage.py b/pym/portage.py index 13c851ab0..e51934b76 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -4795,14 +4795,14 @@ class vardbapi(dbapi): results = [] for x in wants: myfn = self.root+VDB_PATH+"/"+str(mycpv)+"/"+str(x) - if os.access(myfn,os.R_OK): + try: myf = open(myfn, "r") myd = myf.read() myf.close() myd = re.sub("[\n\r\t]+"," ",myd) myd = re.sub(" +"," ",myd) myd = string.strip(myd) - else: + except (IOError, OSError): myd = "" results.append(myd) if "EAPI" in wants: