Import portage before trying to access portage.exception for exception
authorZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 00:46:07 +0000 (00:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 00:46:07 +0000 (00:46 -0000)
handling.

svn path=/main/trunk/; revision=10919

bin/portageq

index 5b7f5f72f98952e54bb89d138cec9560de7ff897..12154df7797aa24166f9e1b4b6f25b3519f6b5b2 100755 (executable)
@@ -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:])