From: Ali Saidi Date: Tue, 10 Jan 2012 01:04:28 +0000 (-0500) Subject: Config: Fix issue with JSON output X-Git-Tag: stable_2012_06_28~275^2~28 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e308208f302b6bccff15f7c694e7ed334e870942;p=gem5.git Config: Fix issue with JSON output --- diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index dcc90e1bc..47ca32af2 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -905,7 +905,15 @@ class SimObject(object): for param in sorted(self._params.keys()): value = self._values.get(param) try: - d[param] = self._values[param].value + # Use native type for those supported by JSON and + # strings for everything else. skipkeys=True seems + # to not work as well as one would hope + if type(self._values[param].value) in \ + [str, unicode, int, long, float, bool, None]: + d[param] = self._values[param].value + else: + d[param] = str(self._values[param]) + except AttributeError: pass