FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-32360: Remove OrderedDict usage from json.tool (GH-5315) · python/cpython@2812d3d · GitHub

Repository navigation

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

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎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)

Back | FazBrowse Home | New Git URL