From 7ca0f41ac7000f6dc42caebe7cb2de0116dbcab9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 21 Dec 2007 00:03:45 +0000 Subject: Bug #202566 - Move the 'global portage' statement to avoid "SyntaxWarning: name 'portage' is assigned to before global declaration" messages produced by earlier python-2.4. svn path=/main/trunk/; revision=9004 --- bin/portageq | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/portageq b/bin/portageq index 972a38392..f23598f75 100755 --- a/bin/portageq +++ b/bin/portageq @@ -435,6 +435,8 @@ def main(): sys.exit(os.EX_USAGE) os.environ["ROOT"] = sys.argv[2] + global portage + # First import the main portage module without legacy globals since it # is almost certain to succeed in that case. This provides access to # the portage.exception namespace which is needed for later exception @@ -444,7 +446,6 @@ def main(): import portage del os.environ["PORTAGE_LEGACY_GLOBALS"] try: - global portage try: reload(portage) except ImportError: -- cgit v1.2.3-1-g7c22