base: Make the Python module loader PEP302 compliant
Review Request #1857 - Created May 1, 2013 and submitted - Latest diff uploaded
| Information | |
|---|---|
| Andreas Sandberg | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9688:349fa0e3e253 --------------------------- base: Make the Python module loader PEP302 compliant The custom Python loader doesn't comply with PEP302 for two reasons: * Previously, we would overwrite old modules on name conflicts. PEP302 explicitly states that: "If there is an existing module object named 'fullname' in sys.modules, the loader must use that existing module". * The "__package__" attribute wasn't set. PEP302: "The __package__ attribute must be set." This changeset addresses both of these issues.
Quick regressions pass (with the exception of 02.insttest and 40.m5threads-test-atomic where I can't find the binaries) for all supported architectures.
