Skip to content

Commit 2812d3d

Browse files
authored
bpo-32360: Remove OrderedDict usage from json.tool (GH-5315)
`object_pairs_hook=OrderedDict` idiom is deprecated.
1 parent f320be7 commit 2812d3d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Lib/json/tool.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
1212
"""
1313
import argparse
14-
import collections
1514
import json
1615
import sys
1716

@@ -34,11 +33,7 @@ def main():
3433
sort_keys = options.sort_keys
3534
with infile:
3635
try:
37-
if sort_keys:
38-
obj = json.load(infile)
39-
else:
40-
obj = json.load(infile,
41-
object_pairs_hook=collections.OrderedDict)
36+
obj = json.load(infile)
4237
except ValueError as e:
4338
raise SystemExit(e)
4439
with outfile:

0 commit comments

Comments
 (0)