From b8f12667b49a5994e0258b8ab88361aceb54bb3b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 19 Mar 2006 04:34:42 +0000 Subject: [PATCH] Catch a possible OSError from the stat call in atomic_ofstream.close(). svn path=/main/trunk/; revision=2950 --- pym/portage_util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/portage_util.py b/pym/portage_util.py index aa84fa74e..ae5312175 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -628,6 +628,11 @@ class atomic_ofstream(file): pass except FileNotFound: pass + except OSError, oe: # from the above os.stat call + if oe.errno in (errno.ENOENT, errno.EPERM): + pass + else: + raise os.rename(self.name, self._real_name) finally: # Make sure we cleanup the temp file -- 2.26.2