ensure that global variables are used to prevent confusing issues like bug #212055
authorMarius Mauch <genone@gentoo.org>
Sun, 2 Mar 2008 13:44:03 +0000 (13:44 -0000)
committerMarius Mauch <genone@gentoo.org>
Sun, 2 Mar 2008 13:44:03 +0000 (13:44 -0000)
svn path=/main/trunk/; revision=9407

pym/portage/elog/__init__.py
pym/portage/elog/messages.py

index 5aa6930c721450192c4e04e49926c2a2182546e1..3039370a3c0a41c214712b465752c1eb9a9e2fbe 100644 (file)
@@ -56,7 +56,7 @@ def _load_mod(name):
 _elog_atexit_handlers = []
 _preserve_logentries = {}
 def elog_process(cpv, mysettings, phasefilter=None):
-
+       global _elog_atexit_handlers, _preserve_logentries
        
        logsystems = mysettings.get("PORTAGE_ELOG_SYSTEM","").split()
        for s in logsystems:
index 888341af532de9b1c5d4e8ed56103e516f1c1643..852b71af917499539e1c95dfb78158a2280346ac 100644 (file)
@@ -47,6 +47,9 @@ def _elog_base(level, msg, phase="other", key=None, color=None):
        """ Backend for the other messaging functions, should not be called 
            directly.
        """
+
+       global _msgbuffer
+
        if color == None:
                color = "GOOD"
        print colorize(color, " * ")+msg
@@ -59,6 +62,8 @@ def _elog_base(level, msg, phase="other", key=None, color=None):
        #raise NotImplementedError()
 
 def collect_messages():
+       global _msgbuffer
+
        rValue = _msgbuffer
        _reset_buffer()
        return rValue
@@ -67,6 +72,8 @@ def _reset_buffer():
        """ Reset the internal message buffer when it has been processed, 
            should not be called directly.
        """
+       global _msgbuffer
+       
        _msgbuffer = {}
 
 # creating and exporting the actual messaging functions