From 05f15f0d6e34cb9a47a3cb3ec44453958f1a3818 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 30 May 2008 20:24:08 +0000 Subject: [PATCH] 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 --- pym/portage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): -- 2.26.2