From b11fd8b9f7ca1a18b2eb9e7506d18258cb5dfd55 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 13 Jul 2012 10:11:16 +0200 Subject: [PATCH] Fix for an Issue #87 --- lib/core/dump.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/core/dump.py b/lib/core/dump.py index cb05a2761..0ebba1a5c 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -77,18 +77,15 @@ class Dump: if isListLike(data): self.lister(header, data, sort) elif data is not None: - if not isinstance(data, bool): - data = getUnicode(data) + _ = getUnicode(data) - if data[-1] == '\n': - data = data[:-1] + if _ and _[-1] == '\n': + _ = _[:-1] - if "\n" in data: - self._write("%s:\n---\n%s\n---\n" % (header, data)) - elif isinstance(data, bool): - self._write("%s: %s\n" % (header, data)) + if "\n" in _: + self._write("%s:\n---\n%s\n---\n" % (header, _)) else: - self._write("%s: '%s'\n" % (header, data)) + self._write("%s: %s\n" % (header, ("'%s'" % _) if isinstance(data, basestring) else _)) else: self._write("%s:\tNone\n" % header)