Skip to content

Commit

Permalink
Convert etc/profilicate.py to Python 3 (servo#31259)
Browse files Browse the repository at this point in the history
  • Loading branch information
syvb authored and Taym95 committed Feb 11, 2024
1 parent 41000dd commit f07cbd4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions etc/profilicate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Copyright 2018 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
Expand Down Expand Up @@ -35,10 +35,10 @@ def get(self, s):
return self.table[s]

def length(self):
return len(self.table.keys())
return len(list(self.table.keys()))

def contents(self):
return sorted(self.table.keys(), key=self.table.__getitem__)
return sorted(list(self.table.keys()), key=self.table.__getitem__)


with open(sys.argv[1]) as f:
Expand All @@ -63,7 +63,7 @@ def contents(self):

tid = 0
threads = []
for (name, raw_samples) in sorted(thread_data.iteritems(), key=lambda x: thread_order[x[0]]):
for (name, raw_samples) in sorted(iter(thread_data.items()), key=lambda x: thread_order[x[0]]):
string_table = StringTable()
tid += 1

Expand Down

0 comments on commit f07cbd4

Please sign in to comment.