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

`object_pairs_hook=OrderedDict` idiom is deprecated.
This commit is contained in:
INADA Naoki 2018-01-25 19:52:58 +09:00 committed by GitHub
parent f320be77ff
commit 2812d3d992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -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: