Commit 2812d3d9 authored by INADA Naoki's avatar INADA Naoki Committed by GitHub

bpo-32360: Remove OrderedDict usage from json.tool (GH-5315)

`object_pairs_hook=OrderedDict` idiom is deprecated.
parent f320be77
...@@ -11,7 +11,6 @@ Usage:: ...@@ -11,7 +11,6 @@ Usage::
""" """
import argparse import argparse
import collections
import json import json
import sys import sys
...@@ -34,11 +33,7 @@ def main(): ...@@ -34,11 +33,7 @@ def main():
sort_keys = options.sort_keys sort_keys = options.sort_keys
with infile: with infile:
try: try:
if sort_keys: obj = json.load(infile)
obj = json.load(infile)
else:
obj = json.load(infile,
object_pairs_hook=collections.OrderedDict)
except ValueError as e: except ValueError as e:
raise SystemExit(e) raise SystemExit(e)
with outfile: with outfile:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment