From 2d4942e36d8de1812ed7938ab5acd0baff6e9b56 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 30 May 2008 20:19:43 +0000 Subject: [PATCH] Make the use_cache=0 listdir() implementation inside vardbapi.cpv_all() rains a PermissionDenied error when appropriate. svn path=/main/trunk/; revision=10505 --- pym/portage/dbapi/vartree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 8f8926231..5c15393fb 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -471,7 +471,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 == PermissionDenied.errno: + raise PermissionDenied(p) + del e return [] for x in listdir(basepath, EmptyOnError=1, ignorecvs=1, dirsonly=1): -- 2.26.2