Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/49407 )
Change subject: scons: When importing SimObjects, use a copy of globals().
......................................................................
scons: When importing SimObjects, use a copy of globals().
Use a copy of globals when importing SimObjects, instead of the real
deal that the SConscript runs under. This avoids polluting the
SConscript namespace.
Change-Id: I689d693d93cc8998be0967ec2b0c58f5851d39cf
---
M src/SConscript
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/SConscript b/src/SConscript
index 72bb2c6..d1244cb 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -585,10 +585,11 @@
importer = M5MetaPathFinder(PySource.modules)
sys.meta_path[0:0] = [ importer ]
+import_globals = globals().copy()
# import all sim objects so we can populate the all_objects list
# make sure that we're working with a list, then let's sort it
for modname in SimObject.modnames:
- exec('from m5.objects import %s' % modname)
+ exec('from m5.objects import %s' % modname, import_globals)
# we need to unload all of the currently imported modules so that they
# will be re-imported the next time the sconscript is run
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49407
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I689d693d93cc8998be0967ec2b0c58f5851d39cf
Gerrit-Change-Number: 49407
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s