#7092: fix DeprecationWarnings for json when the tests are run with -3 -Wd.

This commit is contained in:
Ezio Melotti 2010-01-26 15:57:21 +00:00
parent ef97caf111
commit ffd849618a
3 changed files with 7 additions and 8 deletions

View file

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