summaryrefslogtreecommitdiffstats
path: root/pym/portage/elog
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-11 09:56:43 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-11 09:56:43 -0700
commit12cb62465b130c21080281d78f7bfac077c17dfb (patch)
treed3c809027eaea929079951b20dec03d586e89ee1 /pym/portage/elog
parent51579fb34c19519a585ce2d052a270b6d84a2d97 (diff)
downloadportage-12cb62465b130c21080281d78f7bfac077c17dfb.tar.gz
portage-12cb62465b130c21080281d78f7bfac077c17dfb.tar.bz2
portage-12cb62465b130c21080281d78f7bfac077c17dfb.zip
elog_process: fix ridicoulus newlines bug #386771
This fixes a regression since commit 8a119ea94ecc6668797e3a1358465ef3733f3a3e which added a newline after each character. This boosts efficiency since we no longer convert a strings to lists of characters.
Diffstat (limited to 'pym/portage/elog')
-rw-r--r--pym/portage/elog/__init__.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py
index eeb6e7184..33dac178d 100644
--- a/pym/portage/elog/__init__.py
+++ b/pym/portage/elog/__init__.py
@@ -1,7 +1,11 @@
# elog/__init__.py - elog core functions
-# Copyright 2006-2009 Gentoo Foundation
+# Copyright 2006-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import sys
+if sys.hexversion >= 0x3000000:
+ basestring = str
+
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.util:writemsg',
@@ -53,9 +57,13 @@ def _combine_logentries(logentries):
if previous_type != msgtype:
previous_type = msgtype
rValue.append("%s: %s" % (msgtype, phase))
- for line in msgcontent:
- rValue.append(line.rstrip("\n"))
- rValue.append("")
+ if isinstance(msgcontent, basestring):
+ rValue.append(msgcontent.rstrip("\n"))
+ else:
+ for line in msgcontent:
+ rValue.append(line.rstrip("\n"))
+ if rValue:
+ rValue.append("")
return "\n".join(rValue)
_elog_mod_imports = {}