From a55f54b9030dcb4ebb0d506a8434463eeacb5f8e Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 24 Sep 2011 01:27:40 +0000 Subject: [PATCH] Let lyxpreview2bitmap.py also work on Windows when the PyWin extension modules are not installed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39741 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/lyxpreview_tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py index b24f972155..7f2dcd75e7 100644 --- a/lib/scripts/lyxpreview_tools.py +++ b/lib/scripts/lyxpreview_tools.py @@ -111,7 +111,11 @@ def find_exe_or_terminate(candidates): def run_command_popen(cmd): - pipe = subprocess.Popen(cmd, shell=True, close_fds=True, stdin=subprocess.PIPE, \ + if os.name == 'nt': + unix = False + else: + unix = True + pipe = subprocess.Popen(cmd, shell=unix, close_fds=unix, stdin=subprocess.PIPE, \ stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) cmd_stdout = pipe.communicate()[0] cmd_status = pipe.returncode -- 2.39.5