1 |
commit: 9e6364fe049b5cc59e8cb54f683bbd11d45a7504 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 25 19:35:32 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 25 19:35:32 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e6364fe |
7 |
|
8 |
elog/mod_syslog: fix 1 char msgs, bug #390965 |
9 |
|
10 |
--- |
11 |
pym/portage/elog/mod_syslog.py | 5 +++++ |
12 |
1 files changed, 5 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/pym/portage/elog/mod_syslog.py b/pym/portage/elog/mod_syslog.py |
15 |
index 6455841..c8bf441 100644 |
16 |
--- a/pym/portage/elog/mod_syslog.py |
17 |
+++ b/pym/portage/elog/mod_syslog.py |
18 |
@@ -7,6 +7,9 @@ import syslog |
19 |
from portage.const import EBUILD_PHASES |
20 |
from portage import _encodings |
21 |
|
22 |
+if sys.hexversion >= 0x3000000: |
23 |
+ basestring = str |
24 |
+ |
25 |
_pri = { |
26 |
"INFO" : syslog.LOG_INFO, |
27 |
"WARN" : syslog.LOG_WARNING, |
28 |
@@ -21,6 +24,8 @@ def process(mysettings, key, logentries, fulltext): |
29 |
if not phase in logentries: |
30 |
continue |
31 |
for msgtype,msgcontent in logentries[phase]: |
32 |
+ if isinstance(msgcontent, basestring): |
33 |
+ msgcontent = [msgcontent] |
34 |
for line in msgcontent: |
35 |
line = "%s: %s: %s" % (key, phase, line) |
36 |
if sys.hexversion < 0x3000000 and not isinstance(line, bytes): |