From 23ee701db27b21ff7c21df88430137c68ea38fa4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 4 Aug 2010 00:50:25 -0700 Subject: Add a sanity check in _preload_portage_submodules() to ensure that the loop always terminates. --- pym/portage/proxy/lazyimport.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pym/portage/proxy') 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) -- cgit v1.2.3-1-g7c22