diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-10-15 21:27:16 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-10-15 21:27:16 +0000 |
commit | 4d39af8d89233001d607519a6d94a82d67818779 (patch) | |
tree | 9faafbd284e0e1bc260c61a191533cf485da5528 /lib/thandy/util.py | |
parent | 5bdfb1ef8405a14186637785014aa32337867df5 (diff) |
In python 2.6 and later, simplejson is built-in as json.
git-svn-id: file:///home/or/svnrepo/updater/trunk@17112 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/util.py')
-rw-r--r-- | lib/thandy/util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/thandy/util.py b/lib/thandy/util.py index 2b1c572..b7281ae 100644 --- a/lib/thandy/util.py +++ b/lib/thandy/util.py @@ -4,7 +4,10 @@ import os import sys import tempfile -import simplejson +try: + import json +except ImportError: + import simplejson as json import thandy.formats import thandy.keys @@ -60,7 +63,7 @@ def getKeylist(keys_fname, checkKeys=True): if keys_fname and os.path.exists(keys_fname): f = open(keys_fname, 'r') try: - obj = simplejson.load(f) + obj = json.load(f) finally: f.close() ss, role, path = thandy.formats.checkSignedObj(obj, keydb) |