summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-11 23:26:05 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-11 23:26:05 +0000
commit5b3135413d200e58e602a74a6816e48380e53433 (patch)
tree05bd527b571cfbfba23f627f64fea576bc8af738 /bin/portageq
parent* Raise PermissionDenied from getconfig() when appropriate. (diff)
downloadportage-multirepo-5b3135413d200e58e602a74a6816e48380e53433.tar.gz
portage-multirepo-5b3135413d200e58e602a74a6816e48380e53433.tar.bz2
portage-multirepo-5b3135413d200e58e602a74a6816e48380e53433.zip
Instead of calling sys.exit when a ParseError occurs in the config
constructor, raise a ParseError and make emerge and portageq handle the error. This way consumers of the portage api can handle the ParseError rather than have their application exit. Thanks to lxnay for reporting. svn path=/main/trunk/; revision=8884
Diffstat (limited to 'bin/portageq')
-rwxr-xr-xbin/portageq3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/portageq b/bin/portageq
index 0b7eab6f..972a3839 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -459,6 +459,9 @@ def main():
except portage.exception.PermissionDenied, e:
sys.stderr.write("Permission denied: '%s'\n" % str(e))
sys.exit(e.errno)
+ except portage.exception.ParseError, e:
+ sys.stderr.write("%s\n" % str(e))
+ sys.exit(1)
except ValueError, e:
if not e.args or \
not hasattr(e.args[0], "__len__") or \