python: figure out if the m5.internal package exists even with demandimport

This commit is contained in:
Nathan Binkert 2011-04-15 10:37:28 -07:00
parent 3c78005c1e
commit 1f7f79781e

View file

@ -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: