Page MenuHomeFreeBSD

schedgraph.py: port to Python 3
ClosedPublic

Authored by avg on Dec 23 2021, 10:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 1:33 AM
Unknown Object (File)
Sun, Dec 1, 1:39 AM
Unknown Object (File)
Oct 29 2024, 12:53 PM
Unknown Object (File)
Oct 29 2024, 3:02 AM
Unknown Object (File)
Oct 27 2024, 5:41 AM
Unknown Object (File)
Oct 23 2024, 12:57 AM
Unknown Object (File)
Oct 23 2024, 12:57 AM
Unknown Object (File)
Oct 23 2024, 12:56 AM
Subscribers

Details

Summary

The change does not preserve compatibility with Python 2.7.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Errors
Unit
No Test Coverage
Build Status
Buildable 43575
Build 40463: arc lint + arc unit

Event Timeline

avg requested review of this revision.Dec 23 2021, 10:24 AM

I used to program in Python many years ago, but I am not very good with it now.
This is my attempt to make the script work with Python 3 as it is the default Python now.

It may be worthwhile fixing the code style in the script to conform to PEP8, etc just to appease linters, code editors, etc.

jmg added inline comments.
tools/sched/schedgraph.py
800

Looks like you might want to add @total_ordering to class EventSource
from functools. For more information:
https://portingguide.readthedocs.io/en/latest/comparisons.html

and the decorator definition:
https://docs.python.org/3/library/functools.html#functools.total_ordering

This will complete the port from single func cmp to the new Python 3 method.

per jmg's suggestion add total_ordering decorator to get all
comparison operators

This revision was not accepted when it landed; it landed in state Needs Review.Jan 11 2022, 1:37 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.