summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-26 19:28:29 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-26 19:28:29 +0000
commit4bca0b8c3a43d8afbf3ba52f10abac412b97c511 (patch)
tree48cbb1218aed95e6cd458ef0b5b3e35c44a9489f
parentc2a58b0fb90f111b4362cfc2b80df044ecc7bba3 (diff)
downloadportage-4bca0b8c3a43d8afbf3ba52f10abac412b97c511.tar.gz
portage-4bca0b8c3a43d8afbf3ba52f10abac412b97c511.tar.bz2
portage-4bca0b8c3a43d8afbf3ba52f10abac412b97c511.zip
* Remove PORTAGE_LEGACY_GLOBALS hack for portage import since late
initialization of portage.settings (via ObjectProxy) allows us to rely on being able to access the portage.exception namespace before portage.settings is initialized. * Use portage.settings["ROOT"] instead of portage.root to avoid potential ObjectProxy compatibility issues. svn path=/main/trunk/; revision=10804
-rwxr-xr-xbin/portageq12
1 files changed, 2 insertions, 10 deletions
diff --git a/bin/portageq b/bin/portageq
index fe5260bc0..04e65c8e7 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -462,23 +462,15 @@ def main():
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
- # handling, like if portage.exception.PermissionDenied is raised when
- # constructing the legacy global config instance.
- os.environ["PORTAGE_LEGACY_GLOBALS"] = "false"
- import portage
- del os.environ["PORTAGE_LEGACY_GLOBALS"]
try:
try:
- reload(portage)
+ 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.root
+ sys.argv[2] = portage.settings["ROOT"]
retval = function(sys.argv[2:])
if retval:
sys.exit(retval)