forked from openlp/openlp
fixed an exception
This commit is contained in:
parent
e90f277bd6
commit
21eeac70eb
|
@ -129,15 +129,16 @@ class PdfController(PresentationController):
|
||||||
if os.path.isfile(application_path + '/../mudraw.exe'):
|
if os.path.isfile(application_path + '/../mudraw.exe'):
|
||||||
self.mudrawbin = application_path + '/../mudraw.exe'
|
self.mudrawbin = application_path + '/../mudraw.exe'
|
||||||
else:
|
else:
|
||||||
|
DEVNULL = open(os.devnull, 'wb')
|
||||||
# First try to find mupdf
|
# First try to find mupdf
|
||||||
try:
|
try:
|
||||||
self.mudrawbin = check_output(['which', 'mudraw']).decode(encoding='UTF-8').rstrip('\n')
|
self.mudrawbin = check_output(['which', 'mudraw'], stderr=DEVNULL).decode(encoding='UTF-8').rstrip('\n')
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
self.mudrawbin = ''
|
self.mudrawbin = ''
|
||||||
# if mupdf isn't installed, fallback to ghostscript
|
# if mupdf isn't installed, fallback to ghostscript
|
||||||
if not self.mudrawbin:
|
if not self.mudrawbin:
|
||||||
try:
|
try:
|
||||||
self.gsbin = check_output(['which', 'gs']).rstrip('\n')
|
self.gsbin = check_output(['which', 'gs'], stderr=DEVNULL).decode(encoding='UTF-8').rstrip('\n')
|
||||||
except CalledProcessError:
|
except CalledProcessError:
|
||||||
self.gsbin = ''
|
self.gsbin = ''
|
||||||
# Last option: check if mudraw is placed in OpenLP base folder
|
# Last option: check if mudraw is placed in OpenLP base folder
|
||||||
|
|
Loading…
Reference in New Issue