From: Zac Medico Date: Tue, 19 Jun 2007 21:59:55 +0000 (-0000) Subject: Fix cacheddir() to behave properly if os.listdir() raises errno.EACCES (Permission... X-Git-Tag: v2.2_pre1~1220 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1b6fede42435d2c53db5af3d10cdbc1f2853fb1;p=portage.git Fix cacheddir() to behave properly if os.listdir() raises errno.EACCES (Permission denied). svn path=/main/trunk/; revision=6879 --- 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: