Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/49415 )
Change subject: python: Insert gem5's m5 importer at the front of
sys.meta_path.
......................................................................
python: Insert gem5's m5 importer at the front of sys.meta_path.
This is equivalent to putting a path first in $PATH, ie it will make
sure that m5.foo resolves to gem5's internal m5 package, and not
whatever directory named m5 happens to be nearby.
Change-Id: I762d47da8ed8e4cfdf03e412d7dd7cc91a691b58
---
M src/python/importer.cc
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python/importer.cc b/src/python/importer.cc
index 38c7772..3dd9c4c 100644
--- a/src/python/importer.cc
+++ b/src/python/importer.cc
@@ -84,7 +84,7 @@
global add_module
add_module = importer.add_module
import sys
- sys.meta_path.append(importer)
+ sys.meta_path.insert(0, importer)
_init_all_embedded()
)", m.attr("__dict__"));
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49415
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: I762d47da8ed8e4cfdf03e412d7dd7cc91a691b58
Gerrit-Change-Number: 49415
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s