From f51dffd23153c8f7d064715c544a373ab8e92486 Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Fri, 26 Aug 2011 17:11:50 +0000 Subject: [PATCH] configure.py : replace os.popen with subprocess.Popen git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39526 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/configure.py b/lib/configure.py index cbbb71d325..9fbba18799 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -8,7 +8,7 @@ # \author Bo Peng # Full author contact details are available in file CREDITS. -import sys, os, re, shutil, glob, logging +import glob, logging, os, re, shutil, subprocess, sys # set up logging logging.basicConfig(level = logging.DEBUG, @@ -60,9 +60,7 @@ def cmdOutput(cmd): '''utility function: run a command and get its output as a string cmd: command to run ''' - fout = os.popen(cmd) - output = fout.read() - fout.close() + output = subprocess.check_output(cmd, shell=True) return output.strip() @@ -1104,7 +1102,7 @@ def checkLatexConfig(check_config, bool_docbook): cl.close() # # we have chklayouts.tex, then process it - fout = os.popen(LATEX + ' wrap_chkconfig.ltx') + fout = subprocess.Popen([LATEX, "wrap_chkconfig.ltx"], stdout=subprocess.PIPE).stdout while True: line = fout.readline() if not line: -- 2.39.2