summaryrefslogtreecommitdiffstats
path: root/bin/portageq
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-11 23:46:11 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-11 23:46:11 +0000
commitdee48ce8f7febb304cf4f56251ad7b3316ffaa67 (patch)
tree639c6b16a77e499915f41cde6dec0755175a3290 /bin/portageq
parent06203883b252d39c335f5ef2118f43aa093334b8 (diff)
downloadportage-dee48ce8f7febb304cf4f56251ad7b3316ffaa67.tar.gz
portage-dee48ce8f7febb304cf4f56251ad7b3316ffaa67.tar.bz2
portage-dee48ce8f7febb304cf4f56251ad7b3316ffaa67.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. (trunk r8884) svn path=/main/branches/2.1.2/; revision=8886
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 056502e39..b097889ae 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -411,6 +411,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 \