Skip to content

Commit

Permalink
Update summarize_timer_intervals.py for Python 3
Browse files Browse the repository at this point in the history
Avoid using has_key and run the subprocess.check_output result through
.decode() before printing.
  • Loading branch information
randomascii committed Sep 10, 2019
1 parent 2bfd848 commit 799e56b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/summarize_timer_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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
Expand Down

0 comments on commit 799e56b

Please sign in to comment.