From: Zac Medico Date: Fri, 30 May 2008 20:24:08 +0000 (-0000) Subject: Make the use_cache=0 listdir() implementation inside vardbapi.cpv_all() X-Git-Tag: v2.1.5.3~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=05f15f0d6e34cb9a47a3cb3ec44453958f1a3818;p=portage.git Make the use_cache=0 listdir() implementation inside vardbapi.cpv_all() raise a PermissionDenied error when appropriate. (trunk r10505) svn path=/main/branches/2.1.2/; revision=10506 --- diff --git a/pym/portage.py b/pym/portage.py index 812aaaa5a..557d27880 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6802,7 +6802,10 @@ class vardbapi(dbapi): try: return [x for x in os.listdir(p) \ if os.path.isdir(os.path.join(p, x))] - except EnvironmentError: + except EnvironmentError, e: + if e.errno == portage_exception.PermissionDenied.errno: + raise portage_exception.PermissionDenied(p) + del e return [] for x in listdir(basepath, EmptyOnError=1, ignorecvs=1, dirsonly=1):