diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-19 22:02:26 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-19 22:02:26 +0000 |
commit | 9f023581d3bb939f2f8369c9973889323b67dd5e (patch) | |
tree | d1f07f4f31b9ee829550a620e5d14a3b58279260 /pym/portage.py | |
parent | abd10a156da5c379aa8e17bfd7dde08371cd0d1e (diff) | |
download | portage-9f023581d3bb939f2f8369c9973889323b67dd5e.tar.gz portage-9f023581d3bb939f2f8369c9973889323b67dd5e.tar.bz2 portage-9f023581d3bb939f2f8369c9973889323b67dd5e.zip |
Fix cacheddir() to behave properly if os.listdir() raises errno.EACCES (Permission denied). (trunk r6879)
svn path=/main/branches/2.1.2/; revision=6880
Diffstat (limited to 'pym/portage.py')
-rw-r--r-- | pym/portage.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py index 7558a7b82..ea3fba2fa 100644 --- a/pym/portage.py +++ b/pym/portage.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: |