From fd7c2917b53643e91bdbeff16e87d240c4c950a1 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Sun, 15 Nov 2015 09:15:28 -0800 Subject: [PATCH] fix broken waf --valgrind argument; also make compatible with Python 3 --- wutils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wutils.py b/wutils.py index 5158ac787..68f9555ca 100644 --- a/wutils.py +++ b/wutils.py @@ -115,10 +115,13 @@ def run_argv(argv, env, os_env=None, cwd=None, force_no_valgrind=False): raise WafError("Options --command-template and --valgrind are conflicting") if not env['VALGRIND']: raise WafError("valgrind is not installed") - argv = [env['VALGRIND'], "--leak-check=full", "--show-reachable=yes", "--error-exitcode=1"] + argv + # Use the first program found in the env['VALGRIND'] list + argv = [env['VALGRIND'][0], "--leak-check=full", "--show-reachable=yes", "--error-exitcode=1"] + argv proc = subprocess.Popen(argv, env=proc_env, cwd=cwd, stderr=subprocess.PIPE) + stderrdata = proc.communicate()[1] + stderrdata = stderrdata.decode('utf-8') error = False - for line in proc.stderr: + for line in stderrdata: sys.stderr.write(line) if "== LEAK SUMMARY" in line: error = True