From dea53cba4635dc7bdbf0cc23d591b326758a9584 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 14 Mar 2006 00:47:15 +0000 Subject: [PATCH] Wrap possible exceptions raised by stat call in apply_secpass_permissions. svn path=/main/trunk/; revision=2872 --- pym/portage_util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pym/portage_util.py b/pym/portage_util.py index 205db9b36..7ffe381c4 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -494,7 +494,15 @@ def apply_secpass_permissions(filename, uid=-1, gid=-1, mode=0, unapplied.""" if stat_cached is None: - stat_cached = os.stat(filename) + try: + stat_cached = os.stat(filename) + except OSError, oe: + if oe.errno == errno.EPERM: + raise OperationNotPermitted(oe) + elif oe.errno == errno.ENOENT: + raise FileNotFound(oe) + else: + raise oe all_applied = True -- 2.26.2