Index: utils/perf-training/perf-helper.py =================================================================== --- utils/perf-training/perf-helper.py +++ utils/perf-training/perf-helper.py @@ -114,7 +114,7 @@ # Find the cc1 command used by the compiler. To do this we execute the # compiler with '-###' to figure out what it wants to do. cmd = cmd + ['-###'] - cc_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env).strip() + cc_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, env=env, universal_newlines=True).strip() cc_commands = [] for ln in cc_output.split('\n'): # Filter out known garbage. @@ -296,7 +296,7 @@ counts[a] = counts.get(a,0) + 1 by_count = counts.items() - by_count.sort(key = lambda (_,n): -n) + by_count.sort(key = lambda _,n: -n) return [s for s,n in by_count] def form_by_random(symbol_lists): @@ -340,7 +340,7 @@ # If the user gave us a binary, get all the symbols in the binary by # snarfing 'nm' output. if opts.binary_path is not None: - output = subprocess.check_output(['nm', '-P', opts.binary_path]) + output = subprocess.check_output(['nm', '-P', opts.binary_path], universal_newlines=True) lines = output.split("\n") all_symbols = [ln.split(' ',1)[0] for ln in lines