From 1db1aefc81a7e33e1affd1ab97a87ac759f5aad3 Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Tue, 5 Feb 2013 15:11:45 +0000 Subject: [PATCH] Fix of gramps -v for Graphviz and ghostscript. svn: r21301 --- gramps/grampsapp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index 1c184b2f8..4e54e7dc8 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -282,8 +282,10 @@ def show_settings(): try: dotversion_str = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] + if isinstance(dotversion_str, bytes): + dotversion_str = dotversion_str.decode(sys.stdin.encoding) if dotversion_str: - dotversion_str = dotversion_str.replace('\n','') + dotversion_str = dotversion_str.replace('\n','')[23:27] except: dotversion_str = 'Graphviz not in system PATH' @@ -292,6 +294,8 @@ def show_settings(): gsversion_str = Popen(['gswin32c', '--version'], stdout=PIPE).communicate(input=None)[0] else: gsversion_str = Popen(['gs', '--version'], stdout=PIPE).communicate(input=None)[0] + if isinstance(gsversion_str, bytes): + gsversion_str = gsversion_str.decode(sys.stdin.encoding) if gsversion_str: gsversion_str = gsversion_str.replace('\n', '') except: