From: Nathan Binkert Date: Fri, 15 Apr 2011 17:37:28 +0000 (-0700) Subject: python: figure out if the m5.internal package exists even with demandimport X-Git-Tag: stable_2012_02_02~402 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1f7f79781e5ec6ca619d4c2075305e3bead88c90;p=gem5.git python: figure out if the m5.internal package exists even with demandimport --- 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: