elog/mod_syslog: fix 1 char msgs, bug #390965
authorZac Medico <zmedico@gentoo.org>
Fri, 25 Nov 2011 19:35:32 +0000 (11:35 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 25 Nov 2011 19:35:32 +0000 (11:35 -0800)
pym/portage/elog/mod_syslog.py

index 64558410d6eef00f2274f638195e9dafcac7308a..c8bf441728b3755d9505ed20280620e9aa223750 100644 (file)
@@ -7,6 +7,9 @@ import syslog
 from portage.const import EBUILD_PHASES
 from portage import _encodings
 
+if sys.hexversion >= 0x3000000:
+       basestring = str
+
 _pri = {
        "INFO"   : syslog.LOG_INFO, 
        "WARN"   : syslog.LOG_WARNING, 
@@ -21,6 +24,8 @@ def process(mysettings, key, logentries, fulltext):
                if not phase in logentries:
                        continue
                for msgtype,msgcontent in logentries[phase]:
+                       if isinstance(msgcontent, basestring):
+                               msgcontent = [msgcontent]
                        for line in msgcontent:
                                line = "%s: %s: %s" % (key, phase, line)
                                if sys.hexversion < 0x3000000 and not isinstance(line, bytes):