From: Zac Medico Date: Fri, 30 Nov 2007 19:38:48 +0000 (-0000) Subject: Fix broken module loading logic. X-Git-Tag: v2.1.4~165 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=efda32534112b27e56a1be94e9af41beb39b611d;p=portage.git Fix broken module loading logic. svn path=/main/branches/2.1.2/; revision=8767 --- diff --git a/pym/portage.py b/pym/portage.py index 6033cf609..fe8088e4c 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -506,11 +506,12 @@ def elog_process(cpv, mysettings): # - is nicer than _ for module names, so allow people to use it. s = s.replace("-", "_") try: - logmodule = __import__("elog_modules.mod_"+s) - m = _elog_mod_imports.get(logmodule) + name = "elog_modules.mod_"+s + m = _elog_mod_imports.get(name) if m is None: + logmodule = __import__(name) m = getattr(logmodule, "mod_"+s) - _elog_mod_imports[logmodule] = m + _elog_mod_imports[name] = m except ImportError: pass @@ -585,11 +586,12 @@ def elog_process(cpv, mysettings): try: # FIXME: ugly ad.hoc import code # TODO: implement a common portage module loader - logmodule = __import__("elog_modules.mod_"+s) - m = _elog_mod_imports.get(logmodule) + name = "elog_modules.mod_"+s + m = _elog_mod_imports.get(name) if m is None: + logmodule = __import__(name) m = getattr(logmodule, "mod_"+s) - _elog_mod_imports[logmodule] = m + _elog_mod_imports[name] = m def timeout_handler(signum, frame): raise portage_exception.PortageException( "Timeout in elog_process for system '%s'" % s)