summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-19 21:59:55 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-19 21:59:55 +0000
commitf1b6fede42435d2c53db5af3d10cdbc1f2853fb1 (patch)
treedb67867ed68d7c9f6c41faa664dee7c28ec14d5e
parent6575452cbc87ab6e0238fe5be684c838a2bdfb92 (diff)
downloadportage-f1b6fede42435d2c53db5af3d10cdbc1f2853fb1.tar.gz
portage-f1b6fede42435d2c53db5af3d10cdbc1f2853fb1.tar.bz2
portage-f1b6fede42435d2c53db5af3d10cdbc1f2853fb1.zip
Fix cacheddir() to behave properly if os.listdir() raises errno.EACCES (Permission denied).
svn path=/main/trunk/; revision=6879
-rw-r--r--pym/portage/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index ed440bcbe..31f2f091c 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -193,7 +193,15 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
if mtime != cached_mtime or time.time() - mtime < 4:
if dircache.has_key(mypath):
cacheStale += 1
- list = os.listdir(mypath)
+ try:
+ list = os.listdir(mypath)
+ except EnvironmentError, e:
+ if e.errno != errno.EACCES:
+ raise
+ del e
+ if EmptyOnError:
+ return [], []
+ raise portage.exception.PermissionDenied(mypath)
ftype = []
for x in list:
try: