summaryrefslogtreecommitdiff
path: root/lib/thandy/formats.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-10-15 21:27:16 +0000
committerNick Mathewson <nickm@torproject.org>2008-10-15 21:27:16 +0000
commit4d39af8d89233001d607519a6d94a82d67818779 (patch)
tree9faafbd284e0e1bc260c61a191533cf485da5528 /lib/thandy/formats.py
parent5bdfb1ef8405a14186637785014aa32337867df5 (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/formats.py')
-rw-r--r--lib/thandy/formats.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/thandy/formats.py b/lib/thandy/formats.py
index c44c9cf..42e3d79 100644
--- a/lib/thandy/formats.py
+++ b/lib/thandy/formats.py
@@ -1,6 +1,10 @@
# Copyright 2008 The Tor Project, Inc. See LICENSE for licensing information.
-import simplejson
+try:
+ import json
+except ImportError:
+ import simplejson as json
+
import time
import re
import binascii
@@ -154,7 +158,7 @@ def checkSignatures(signed, keyDB, role=None, path=None):
return SignatureStatus(goodSigs, badSigs, unknownSigs, tangentialSigs)
def _encodeCanonical(obj, outf):
- # Helper for encodeCanonical. Older versions of simplejson.encoder don't
+ # Helper for encodeCanonical. Older versions of json.encoder don't
# even let us replace the separators.
def canonical_str_encoder(s):