summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-04 00:50:25 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-04 00:50:25 -0700
commit23ee701db27b21ff7c21df88430137c68ea38fa4 (patch)
treed7d550b84f011ccd1d316183c96e7b418926fe99
parentb7e7cb33096ea730f65c7eee600c823db8bd68f9 (diff)
downloadportage-23ee701db27b21ff7c21df88430137c68ea38fa4.tar.gz
portage-23ee701db27b21ff7c21df88430137c68ea38fa4.tar.bz2
portage-23ee701db27b21ff7c21df88430137c68ea38fa4.zip
Add a sanity check in _preload_portage_submodules() to ensure that the
loop always terminates.
-rw-r--r--pym/portage/proxy/lazyimport.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/portage/proxy/lazyimport.py b/pym/portage/proxy/lazyimport.py
index b5a2385d3..b5d15931b 100644
--- a/pym/portage/proxy/lazyimport.py
+++ b/pym/portage/proxy/lazyimport.py
@@ -28,10 +28,14 @@ def _preload_portage_submodules():
so some portage submodules may still remain unimported
after this function is called.
"""
+ imported = set()
while True:
remaining = False
for name in list(_module_proxies):
if name.startswith('portage.'):
+ if name in imported:
+ continue
+ imported.add(name)
remaining = True
__import__(name)
_unregister_module_proxy(name)