diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-09 20:31:50 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-09 20:31:50 +0000 |
commit | 2cea761d00a6460fce680cfd7f7bece2e138e569 (patch) | |
tree | 5eeae9fd52ca40aa7564244770d4f035725c34fb | |
parent | 5cd6e36273f2d5674aa47970eb1207de3ac3bc4a (diff) | |
download | portage-2cea761d00a6460fce680cfd7f7bece2e138e569.tar.gz portage-2cea761d00a6460fce680cfd7f7bece2e138e569.tar.bz2 portage-2cea761d00a6460fce680cfd7f7bece2e138e569.zip |
Update error handling for write_atomic calls to use PortageException.
svn path=/main/trunk/; revision=3823
-rwxr-xr-x | bin/emaint | 4 | ||||
-rw-r--r-- | pym/portage.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/emaint b/bin/emaint index 472656bc7..4bf27e6ae 100755 --- a/bin/emaint +++ b/bin/emaint @@ -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 diff --git a/pym/portage.py b/pym/portage.py index 424b637a1..80358d4ed 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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) |