python: figure out if the m5.internal package exists even with demandimport
This commit is contained in:
parent
3c78005c1e
commit
1f7f79781e
1 changed files with 6 additions and 1 deletions
|
@ -31,8 +31,13 @@
|
||||||
# scripts while allowing new SCons code to operate properly.
|
# scripts while allowing new SCons code to operate properly.
|
||||||
|
|
||||||
try:
|
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:
|
except ImportError:
|
||||||
|
# The import failed
|
||||||
internal = None
|
internal = None
|
||||||
|
|
||||||
if internal:
|
if internal:
|
||||||
|
|
Loading…
Reference in a new issue