From: Zac Medico Date: Fri, 4 Jul 2008 00:46:07 +0000 (-0000) Subject: Import portage before trying to access portage.exception for exception X-Git-Tag: v2.2_rc2~219 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e97b8f08b2ebcded360ea1d9c11420e7d931234b;p=portage.git Import portage before trying to access portage.exception for exception handling. svn path=/main/trunk/; revision=10919 --- 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:])