summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-04-15 10:37:28 -0700
committerNathan Binkert <nate@binkert.org>2011-04-15 10:37:28 -0700
commit1f7f79781e5ec6ca619d4c2075305e3bead88c90 (patch)
treebb894d50d0f3a36ae37b11483c5a019a46e70b8a /src/python
parent3c78005c1e0bfc070ff21bfc145eb250eda71b7a (diff)
downloadgem5-1f7f79781e5ec6ca619d4c2075305e3bead88c90.tar.xz
python: figure out if the m5.internal package exists even with demandimport
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index 9f9459ae8..b5af7a80f 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -31,8 +31,13 @@
# scripts while allowing new SCons code to operate properly.
try:
- import internal
+ # Try to import something that's generated by swig
+ import internal.core
+
+ # Try to grab something from it in case demandimport is being used
+ internal.core.__package__
except ImportError:
+ # The import failed
internal = None
if internal: