diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-03-05 17:53:21 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-03-05 17:53:21 (GMT) |
commit | 0adfd2167fa4b7aa2c3be8a2642f11bc2b41867c (patch) | |
tree | 53e058164a70227fea1717f7e9f7955b1b478345 | |
parent | 8d4aed498665c0eb1c9e78448979d6f15a91a058 (diff) |
Use simplejson instead of json-py to satisfy python26
-rwxr-xr-x | colors.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -29,9 +29,15 @@ # Sharing - http://wiki.laptop.org/go/Shared_Sugar_Activities # Import standard Python modules. -import logging, os, math, time, copy, json, tempfile +import logging, os, math, time, copy, tempfile from gettext import gettext as _ +try: + import json + json.dumps +except (ImportError, AttributeError): + import simplejson as json + # Import the C++ component of the activity. from colorsc.colorsc import * @@ -581,7 +587,7 @@ class Colors(activity.Activity, ExportedGObject): samples = [] fd = open(activity.get_bundle_path() + '/data/INDEX', 'r') try: - samples = json.read(fd.read()) + samples = json.loads(fd.read()) finally: fd.close() |