From: Enrico Forestieri Date: Sat, 24 Sep 2011 01:27:40 +0000 (+0000) Subject: Let lyxpreview2bitmap.py also work on Windows when the PyWin extension modules X-Git-Tag: 2.1.0beta1~2669 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a55f54b9030dcb4ebb0d506a8434463eeacb5f8e;p=features.git 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 --- 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