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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user