From 799e56b0ea7c024b338e5f6b3fef59a992b38c01 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Tue, 10 Sep 2019 00:23:40 -0700 Subject: [PATCH] Update summarize_timer_intervals.py for Python 3 Avoid using has_key and run the subprocess.check_output result through .decode() before printing. --- bin/summarize_timer_intervals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/summarize_timer_intervals.py b/bin/summarize_timer_intervals.py index c5ff3414..f547253c 100644 --- a/bin/summarize_timer_intervals.py +++ b/bin/summarize_timer_intervals.py @@ -66,7 +66,7 @@ print('Couldn\'t find \"%s\". This should be part of the UIforETW repo and releases' % profilePath) sys.exit(0) -if os.environ.has_key('ProgramFiles(x86)'): +if 'ProgramFiles(x86)' in os.environ: progFilesx86 = os.environ['ProgramFiles(x86)'] else: progFilesx86 = os.environ['ProgramFiles'] @@ -78,7 +78,7 @@ wpaCommand = r'"%s" "%s" -profile "%s"' % (wpaExporterPath, trace_name, profilePath) print('> %s' % wpaCommand) -print(subprocess.check_output(wpaCommand, stderr=subprocess.STDOUT)) +print(subprocess.check_output(wpaCommand, stderr=subprocess.STDOUT).decode()) # This dictionary of lists accumulates the data. The key is a process (pid) name # and the payload is a list containing interval/timestamp pairs. The timer