Consolidate definition of json_decode and _json_encode.
@@ -142,14 +142,12 @@ def unquote_qs(atom, encoding, errors='strict'):
try:
- # Prefer simplejson, which is usually more advanced than the builtin
- # module.
+ # Prefer simplejson
import simplejson as json
- json_decode = json.JSONDecoder().decode
- _json_encode = json.JSONEncoder().iterencode
except ImportError:
- # json is part of the standard library
import json
+
+
json_decode = json.JSONDecoder().decode
_json_encode = json.JSONEncoder().iterencode
