mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Convert etc/profilicate.py to Python 3 (#31259)
This commit is contained in:
parent
d7d0451424
commit
e588e93b3b
1 changed files with 4 additions and 4 deletions
|
@ -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.
|
||||
|
@ -35,10 +35,10 @@ class StringTable:
|
|||
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:
|
||||
|
@ -63,7 +63,7 @@ for sample in samples:
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue