mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
#7092: fix DeprecationWarnings for json when the tests are run with -3 -Wd.
This commit is contained in:
parent
ef97caf111
commit
ffd849618a
3 changed files with 7 additions and 8 deletions
|
@ -266,8 +266,6 @@ class JSONEncoder(object):
|
|||
def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
|
||||
_key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot,
|
||||
## HACK: hand-optimized bytecode; turn globals into locals
|
||||
False=False,
|
||||
True=True,
|
||||
ValueError=ValueError,
|
||||
basestring=basestring,
|
||||
dict=dict,
|
||||
|
@ -354,8 +352,7 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
|
|||
item_separator = _item_separator
|
||||
first = True
|
||||
if _sort_keys:
|
||||
items = dct.items()
|
||||
items.sort(key=lambda kv: kv[0])
|
||||
items = sorted(dct.items(), key=lambda kv: kv[0])
|
||||
else:
|
||||
items = dct.iteritems()
|
||||
for key, value in items:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue