From dfd6e419460bdd624b3a2cd58630f8e0f0a5ca96 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Mon, 20 Jun 2016 15:35:58 +0200 Subject: [PATCH] first print stdout, then stderr; fixes #174 --- autocmake/configure.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autocmake/configure.py b/autocmake/configure.py index 9ca39b3..74cf7cf 100644 --- a/autocmake/configure.py +++ b/autocmake/configure.py @@ -93,16 +93,21 @@ def run_cmake(command, build_path, default_build_path): stdout_coded, stderr_coded = p.communicate() stdout = stdout_coded.decode('UTF-8') stderr = stderr_coded.decode('UTF-8') + + # print cmake output to screen + print(stdout) + if stderr: sys.stderr.write(stderr) sys.exit(1) - # print cmake output to screen - print(stdout) + # write cmake output to file with open('cmake_output', 'w') as f: f.write(stdout) + # change directory and return os.chdir(topdir) + if 'Configuring incomplete' in stdout: # configuration was not successful if (build_path == default_build_path):