summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC Nelson <cnelsonsic@gmail.com>2012-04-06 12:38:22 -0500
committerC Nelson <cnelsonsic@gmail.com>2012-04-06 12:38:22 -0500
commit015d676f5a275261858bafd3d60ba180323403b6 (patch)
treea1bf48571cef7b104d5e54bda11d200c5b83581d
parentcf9d55b81131cc6d037a7f6fe892d0d995783281 (diff)
Adding compatibility for newer versions of json.
original-commit-id: 1d17d3e8104606da398becc8430d02aba5eea06b
-rw-r--r--crystal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/crystal.py b/crystal.py
index 95b326d..211c132 100644
--- a/crystal.py
+++ b/crystal.py
@@ -24,6 +24,10 @@ if not hasattr(unittest.TestCase, 'setUpClass'):
if not hasattr(json, "dumps"):
json.dumps = json.write
+# New versions of json don't have read anymore.
+if not hasattr(json, "read"):
+ json.read = json.loads
+
#table of pointers to map groups
#each map group contains some number of map headers
map_group_pointer_table = 0x94000