From efda32534112b27e56a1be94e9af41beb39b611d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 30 Nov 2007 19:38:48 +0000 Subject: [PATCH] Fix broken module loading logic. svn path=/main/branches/2.1.2/; revision=8767 --- pym/portage.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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) -- 2.26.2