From 6ddb43d4cefac01b12ce9d2655b36180a8932acb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Jul 2007 04:31:03 +0000 Subject: For bug #180165, make portageq print a "Permission denied" error when appropriate and make has_version die if portageq has an unexpected exit code. (branches/2.1.2 r6885) svn path=/main/branches/2.1.2.9/; revision=7470 --- pym/portage.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pym/portage.py') diff --git a/pym/portage.py b/pym/portage.py index 2a153a298..2ee843c2b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -185,7 +185,14 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli mtime = pathstat[stat.ST_MTIME] else: raise portage_exception.DirectoryNotFound(mypath) - except (IOError,OSError,portage_exception.PortageException): + except EnvironmentError, e: + if e.errno == portage_exception.PermissionDenied.errno: + raise portage_exception.PermissionDenied(mypath) + del e + if EmptyOnError: + return [], [] + return None, None + except portage_exception.PortageException: if EmptyOnError: return [], [] return None, None @@ -199,8 +206,6 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli if e.errno != errno.EACCES: raise del e - if EmptyOnError: - return [], [] raise portage_exception.PermissionDenied(mypath) ftype = [] for x in list: -- cgit v1.2.3-1-g7c22