Hello Gabe Black, Jason Lowe-Power, Juha Jäykkä, Giacomo Travaglini, Ciro
Santilli,
I'd like you to reexamine a change. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/15982
to look at the new patch set (#11).
Change subject: python: Make meta class declarations Python 3 safe
......................................................................
python: Make meta class declarations Python 3 safe
Python 2.x and Python 3 use different meta class syntax. Fix this by
implementing meta classes using the add_metaclass decorator in the six
Python library.
Due to the way meta classes are implemented in six,
MetaParamValue.__new__ seems to be called twice for some classes. This
triggers an assertion which when param that checks that Param types
have only been registered once. I have turned this assertion into a
warning.
The assertion was triggered in params.CheckedInt and params.Enum. It
seems like the cause of the issue is that these classes have their own
meta classes (CheckedIntType and MetaEnum) that inherit from
MetaParamValue and a base class (ParamValue) that also inherits from
MetaParamValue.
Change-Id: I5dea08bf0558cfca57897a124cb131c78114e59e
Signed-off-by: Andreas Sandberg <[email protected]>
---
M src/python/m5/SimObject.py
M src/python/m5/params.py
M src/python/m5/util/code_formatter.py
M src/python/m5/util/pybind.py
4 files changed, 16 insertions(+), 13 deletions(-)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15982
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I5dea08bf0558cfca57897a124cb131c78114e59e
Gerrit-Change-Number: 15982
Gerrit-PatchSet: 11
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Juha Jäykkä <[email protected]>
Gerrit-MessageType: newpatchset
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev