summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/simulate.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 29d14f75d..38129592c 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -31,7 +31,6 @@
import atexit
import os
import sys
-import json
# import the SWIG-wrapped main C++ functions
import internal
@@ -74,10 +73,14 @@ def instantiate(ckpt_dir=None):
ini_file.close()
if options.json_config:
- json_file = file(os.path.join(options.outdir, options.json_config), 'w')
- d = root.get_config_as_dict()
- json.dump(d, json_file, indent=4)
- json_file.close()
+ try:
+ import json
+ json_file = file(os.path.join(options.outdir, options.json_config), 'w')
+ d = root.get_config_as_dict()
+ json.dump(d, json_file, indent=4)
+ json_file.close()
+ except ImportError:
+ pass
# Initialize the global statistics