summaryrefslogtreecommitdiffstats
path: root/Lib/json/encoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/encoder.py')
-rw-r--r--Lib/json/encoder.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/json/encoder.py b/Lib/json/encoder.py
index 027a1a6..d8692c4 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -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: