diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-07 22:29:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-07 22:29:13 +0000 |
commit | 53f14db70339391fb13ca0adab353645f84be3f2 (patch) | |
tree | 29c22c8bfc64557b67053fa1751f73812bcd091c | |
parent | 295d6ca584c205b419ab37e1be620fb172a3518b (diff) | |
download | portage-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.py | 4 |
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: |