From 113fbcfc7f3f8b55060de8b0ba9ec784de020311 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Thu, 7 Mar 2013 23:30:03 +0000 Subject: [PATCH] handle CLI pathological case svn: r21583 --- gramps/grampsapp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index 0d563473b..b0844f680 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -300,7 +300,7 @@ def show_settings(): try: dotversion_str = Popen(['dot', '-V'], stderr=PIPE).communicate(input=None)[1] - if isinstance(dotversion_str, bytes): + if isinstance(dotversion_str, bytes) and sys.stdin.encoding: dotversion_str = dotversion_str.decode(sys.stdin.encoding) if dotversion_str: dotversion_str = dotversion_str.replace('\n','')[23:27] @@ -312,7 +312,7 @@ 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): + if isinstance(gsversion_str, bytes) and sys.stdin.encoding: gsversion_str = gsversion_str.decode(sys.stdin.encoding) if gsversion_str: gsversion_str = gsversion_str.replace('\n', '')