changeset fd3f7091a5cf in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=fd3f7091a5cf
description:
config: Fix json output for Python lt 2.6.
diffstat:
src/python/m5/simulate.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (30 lines):
diff -r be72c2a127b2 -r fd3f7091a5cf src/python/m5/simulate.py
--- a/src/python/m5/simulate.py Mon Jan 09 18:10:05 2012 -0600
+++ b/src/python/m5/simulate.py Tue Jan 10 10:17:33 2012 -0600
@@ -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 @@
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
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev