From 53f14db70339391fb13ca0adab353645f84be3f2 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 7 Dec 2006 22:29:13 +0000 Subject: Catch an exception instead of using a redundant os.access call. svn path=/main/trunk/; revision=5209 --- pym/portage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pym/portage.py') 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: -- cgit v1.2.3-1-g7c22