Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert etc/profilicate.py to Python 3 #31259

Merged
merged 1 commit into from Feb 5, 2024
Merged

Conversation

syvb
Copy link
Contributor

@syvb syvb commented Feb 5, 2024

Converts etc/profilicate.py (a script for processing raw profiler samples) from Python 2 to Python 3, to make it easier to run on modern systems. I used 2to3, then removed unnecessary double brackets and updated the shebang.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • These changes do not require tests because it is a testing script

@jdm jdm added this pull request to the merge queue Feb 5, 2024
@@ -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]]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the iter() is is not needed in this case, since sorted can consume iterables directly and items() returns view objects that are iterable.

Merged via the queue into servo:main with commit e588e93 Feb 5, 2024
9 checks passed
@syvb syvb deleted the py3-profilicate branch February 6, 2024 03:01
Taym95 pushed a commit to Taym95/servo that referenced this pull request Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants