diff --git a/Lib/mailcap.py b/Lib/mailcap.py index 086f05c5813..bc93026dcde 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -239,14 +239,12 @@ def show(caps): if not caps: caps = getcaps() print("Mailcap entries:") print() - ckeys = caps.keys() - ckeys.sort() + ckeys = sorted(caps) for type in ckeys: print(type) entries = caps[type] for e in entries: - keys = e.keys() - keys.sort() + keys = sorted(e) for k in keys: print(" %-15s" % k, e[k]) print()