scons: Update the special module importer API.

In the SConscript, there is a special importer which enables importing
embedded code using various m5.* paths. This was implemented using an
API which has been deprecated and replaced in more recent versions of
python.

Change-Id: I5900f269af48befbcedcb9d25353f04f6297ce9d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48363
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Gabe Black
2021-07-17 00:18:40 -07:00
parent 1853d57dc3
commit 9db4c91510
3 changed files with 82 additions and 75 deletions

View File

@@ -28,10 +28,10 @@ from m5.internal import params
from m5.SimObject import *
try:
modules = __loader__.modules
modules = __spec__.loader_state
except NameError:
modules = { }
for module in modules.keys():
for module in modules:
if module.startswith('m5.objects.'):
exec("from %s import *" % module)