From 8e812f44af04dac05db0b45957c083ed6b682079 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 29 Aug 2011 16:23:58 +0000 Subject: [PATCH] Avoid code duplication. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39561 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/configure.py b/lib/configure.py index 16c7e4c4cd..382e1ca5c9 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -1111,23 +1111,14 @@ def checkLatexConfig(check_config, bool_docbook): cl.close() # # we have chklayouts.tex, then process it - 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() - if not line: - break; + ret = 1 + latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx') + for line in latex_out.splitlines(): if re.match('^\+', line): logger.info(line.strip()) - # if the command succeeds, None will be returned - ret = pipe.stdout.close() + # return None if the command succeeds + if line == "+Inspection done.": + ret = None # # currently, values in chhkconfig are only used to set # \font_encoding -- 2.39.5