summaryrefslogtreecommitdiff
path: root/Lib/pprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r--Lib/pprint.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index f77a0e2248..19a3dc249c 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -246,7 +246,7 @@ def _safe_repr(object, context, maxlevels, level):
append = components.append
level += 1
saferepr = _safe_repr
- for k, v in object.iteritems():
+ for k, v in sorted(object.items()):
krepr, kreadable, krecur = saferepr(k, context, maxlevels, level)
vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level)
append("%s: %s" % (krepr, vrepr))