summaryrefslogtreecommitdiffstats
path: root/Lib/json/tool.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-01-25 10:52:58 (GMT)
committerGitHub <noreply@github.com>2018-01-25 10:52:58 (GMT)
commit2812d3d99287c50bab99625d7240bcf1c2e32369 (patch)
tree36732b4a7dfa0180131767f08ff45bee18f7c16c /Lib/json/tool.py
parentf320be77ffb73e3b9e7fc98c37b8df3975d84b40 (diff)
downloadcpython-2812d3d99287c50bab99625d7240bcf1c2e32369.zip
cpython-2812d3d99287c50bab99625d7240bcf1c2e32369.tar.gz
cpython-2812d3d99287c50bab99625d7240bcf1c2e32369.tar.bz2
bpo-32360: Remove OrderedDict usage from json.tool (GH-5315)
`object_pairs_hook=OrderedDict` idiom is deprecated.
Diffstat (limited to 'Lib/json/tool.py')
-rw-r--r--Lib/json/tool.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/json/tool.py b/Lib/json/tool.py
index 4f3182c..5932f4e 100644
--- a/Lib/json/tool.py
+++ b/Lib/json/tool.py
@@ -11,7 +11,6 @@ Usage::
"""
import argparse
-import collections
import json
import sys
@@ -34,11 +33,7 @@ def main():
sort_keys = options.sort_keys
with infile:
try:
- if sort_keys:
- obj = json.load(infile)
- else:
- obj = json.load(infile,
- object_pairs_hook=collections.OrderedDict)
+ obj = json.load(infile)
except ValueError as e:
raise SystemExit(e)
with outfile: