summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-07 22:29:13 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-07 22:29:13 +0000
commit53f14db70339391fb13ca0adab353645f84be3f2 (patch)
tree29c22c8bfc64557b67053fa1751f73812bcd091c
parent295d6ca584c205b419ab37e1be620fb172a3518b (diff)
downloadportage-53f14db70339391fb13ca0adab353645f84be3f2.tar.gz
portage-53f14db70339391fb13ca0adab353645f84be3f2.tar.bz2
portage-53f14db70339391fb13ca0adab353645f84be3f2.zip
Catch an exception instead of using a redundant os.access call.
svn path=/main/trunk/; revision=5209
-rw-r--r--pym/portage.py4
1 files changed, 2 insertions, 2 deletions
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: