From: Zac Medico Date: Tue, 14 Mar 2006 00:47:15 +0000 (-0000) Subject: Wrap possible exceptions raised by stat call in apply_secpass_permissions. X-Git-Tag: v2.1_pre7~100 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dea53cba4635dc7bdbf0cc23d591b326758a9584;p=portage.git Wrap possible exceptions raised by stat call in apply_secpass_permissions. svn path=/main/trunk/; revision=2872 --- 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