From 4d39af8d89233001d607519a6d94a82d67818779 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 15 Oct 2008 21:27:16 +0000 Subject: 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 --- lib/thandy/util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/thandy/util.py') 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) -- cgit v1.2.3