diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-04 00:46:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-04 00:46:07 +0000 |
commit | e97b8f08b2ebcded360ea1d9c11420e7d931234b (patch) | |
tree | 8418ab0b7c78658cad11fab998e7c0aa348cb7bb | |
parent | 0ae9252cfc891db0a6882b3732c92f0c3df3dfe0 (diff) | |
download | portage-e97b8f08b2ebcded360ea1d9c11420e7d931234b.tar.gz portage-e97b8f08b2ebcded360ea1d9c11420e7d931234b.tar.bz2 portage-e97b8f08b2ebcded360ea1d9c11420e7d931234b.zip |
Import portage before trying to access portage.exception for exception
handling.
svn path=/main/trunk/; revision=10919
-rwxr-xr-x | bin/portageq | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/portageq b/bin/portageq index 5b7f5f72f..12154df77 100755 --- a/bin/portageq +++ b/bin/portageq @@ -475,14 +475,15 @@ def main(): os.environ["ROOT"] = sys.argv[2] global portage + try: + import portage + except ImportError: + from os import path as osp + sys.path.insert(0, osp.join(osp.dirname( + osp.dirname(osp.realpath(__file__))), "pym")) + import portage try: - try: - import portage - except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage if uses_root: sys.argv[2] = portage.settings["ROOT"] retval = function(sys.argv[2:]) |