From aa1c87c4d08d79e152478235da8c187a403db07f Mon Sep 17 00:00:00 2001 From: Kload Date: Sat, 21 Dec 2013 11:21:13 +0100 Subject: [PATCH] Avoid fail when pprint an unicode character --- yunohost.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yunohost.py b/yunohost.py index 2722ba95..f75ee7ac 100644 --- a/yunohost.py +++ b/yunohost.py @@ -105,7 +105,9 @@ def pretty_print_dict(d, depth=0): else: print((" ") * (depth+1) + "- " +str(value)) else: - print((" ") * depth + "%s: %s" % (str(k), str(v))) + if not isinstance(v, basestring): + v = str(v) + print((" ") * depth + "%s: %s" % (str(k), v)) def is_true(arg): true_list = ['yes', 'Yes', 'true', 'True' ]