Update error handling for write_atomic calls to use PortageException.
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Jul 2006 20:31:50 +0000 (20:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Jul 2006 20:31:50 +0000 (20:31 -0000)
svn path=/main/trunk/; revision=3823

bin/emaint
pym/portage.py

index 472656bc78c6d3fc69153db349fee97363898e12..4bf27e6ae5e7d94a6176c868bb6a58e53f3b509f 100755 (executable)
@@ -7,7 +7,7 @@ from optparse import OptionParser, OptionValueError
 
 import re
 
-import os, portage, portage_const
+import os, portage, portage_const, portage_exception
 class WorldHandler(object):
 
        def name():
@@ -42,7 +42,7 @@ class WorldHandler(object):
                errors = []
                try:
                        portage.write_atomic(self.world_file, "\n".join(self.okay))
-               except OSError:
+               except portage_exception.PortageException:
                        errors.append(self.world_file + " could not be opened for writing")
                return errors
 
index 424b637a16d400368d4e89d348838b81b35cf422..80358d4ed4fa358b0e8fa76a83cacaa64d912eff 100644 (file)
@@ -7009,7 +7009,7 @@ def update_config_files(config_root, protect, protect_mask, update_iter):
                        updating_file = new_protect_filename(updating_file)[0]
                try:
                        write_atomic(updating_file, "".join(file_contents[x]))
-               except (OSError, IOError), e:
+               except portage_exception.PortageException, e:
                        writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
                        writemsg("!!! An error occured while updating a config file:" + \
                                " '%s'\n" % updating_file, noiselevel=-1)