python: Make it possible to import the parts of m5 that are pure python
authorNathan Binkert <nate@binkert.org>
Sun, 16 Aug 2009 20:39:59 +0000 (13:39 -0700)
committerNathan Binkert <nate@binkert.org>
Sun, 16 Aug 2009 20:39:59 +0000 (13:39 -0700)
src/python/m5/__init__.py

index 733258acf2a000bed27a4946c52f8f0fece970d5..c3512cd0dd39d1a506375098b8763571ab09e086 100644 (file)
@@ -103,8 +103,11 @@ try:
 except ImportError:
     internal = None
 
-import defines
-build_env.update(defines.buildEnv)
+try:
+    import defines
+    build_env.update(defines.buildEnv)
+except ImportError:
+    defines = None
 
 if internal:
     defines.compileDate = internal.core.compileDate
@@ -120,4 +123,8 @@ if internal:
 
 import SimObject
 import params
-import objects
+
+try:
+    import objects
+except ImportError:
+    objects = None