Fix bug #7718 (Configure fails if shell autorun commands are enabled in the registry)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39554 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2011-08-28 22:57:58 +00:00
parent 3d82ff41ec
commit 1126e3dfd8

View File

@ -60,7 +60,12 @@ def cmdOutput(cmd):
'''utility function: run a command and get its output as a string
cmd: command to run
'''
pipe = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, \
if os.name == 'nt':
b = False
cmd = 'cmd /d /c ' + cmd
else:
b = True
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, universal_newlines=True)
pipe.stdin.close()
output = pipe.stdout.read()
@ -1106,9 +1111,14 @@ def checkLatexConfig(check_config, bool_docbook):
cl.close()
#
# we have chklayouts.tex, then process it
pipe = subprocess.Popen([LATEX, "wrap_chkconfig.ltx"], \
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
universal_newlines=True)
cmd = LATEX + ' wrap_chkconfig.ltx'
if os.name == 'nt':
b = False
cmd = 'cmd /d /c ' + cmd
else:
b = True
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, universal_newlines=True)
pipe.stdin.close()
while True:
line = pipe.stdout.readline()