From 1f7f79781e5ec6ca619d4c2075305e3bead88c90 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 15 Apr 2011 10:37:28 -0700 Subject: [PATCH] python: figure out if the m5.internal package exists even with demandimport --- src/python/m5/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: