summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-01-10 10:18:08 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2012-01-10 10:18:08 -0600
commitcfa1d26b43614af88154f6015a7f3a4a6b7c08de (patch)
treeaa80e7633f6cb71e7238817db6058633f6323dac /src/python
parent9957035a42653a0666e30c744ab02fb0074db3a3 (diff)
parent8f18898e85ade3233502acd0dbc7cf9cd416d880 (diff)
downloadgem5-cfa1d26b43614af88154f6015a7f3a4a6b7c08de.tar.xz
Automated merge with ssh://repo.gem5.org/gem5
Diffstat (limited to 'src/python')
-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