mirror of
https://github.com/httpie/cli.git
synced 2026-06-20 11:32:56 +02:00
Work around missing object_pairs_hook in Python 2.6
This commit is contained in:
1 parent
22c993bab8
commit
25b1be7c8a
4 files changed
+32
-14
No files matched your search
@@ -1,4 +1,13 @@
|
||||
from __future__ import division
|
||||
import json
|
||||
|
||||
from httpie.compat import is_py26, OrderedDict
|
||||
|
||||
|
||||
def load_json_preserve_order(s):
|
||||
if is_py26:
|
||||
return json.loads(s)
|
||||
return json.loads(s, object_pairs_hook=OrderedDict)
|
||||
|
||||
|
||||
def humanize_bytes(n, precision=2):
|
||||
|
||||
Reference in new issue
Block a user