summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: