[elbe-devel] [PATCH 13/13] asciidoclog: enforce to log strings

Manuel Traut manut at linutronix.de
Thu Nov 30 15:15:15 CET 2017


if not, logging might raise an exception if an integer was passed in

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/asciidoclog.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elbepack/asciidoclog.py b/elbepack/asciidoclog.py
index fea37212..93095a8c 100644
--- a/elbepack/asciidoclog.py
+++ b/elbepack/asciidoclog.py
@@ -28,7 +28,7 @@ class LogBase(object):
         self.fp = fp
 
     def printo(self, text=""):
-        self.fp.write(text+"\n")
+        self.fp.write("%s\n" % str(text))
 
     def print_raw(self, text):
         self.fp.write(text)
@@ -36,13 +36,13 @@ class LogBase(object):
     def h1(self, text):
         self.printo()
         self.printo(text)
-        self.printo("="*len(text))
+        self.printo("="*len(str(text)))
         self.printo()
 
     def h2(self, text):
         self.printo()
         self.printo(text)
-        self.printo("-"*len(text))
+        self.printo("-"*len(str(text)))
         self.printo()
 
     def table(self):
-- 
2.15.1




More information about the elbe-devel mailing list