summaryrefslogtreecommitdiff
path: root/paste/exceptions
diff options
context:
space:
mode:
authorNils Philippsen <nils@redhat.com>2015-11-12 13:28:38 +0100
committerNils Philippsen <nils@redhat.com>2015-11-12 13:28:38 +0100
commit200666040ff737181662824ea33cd019890181f9 (patch)
tree53e36c498fe396b710bf8a738a21a228ed574a42 /paste/exceptions
parent75020c5f92846963892798514df48d8a2ad6b8a5 (diff)
downloadpaste-200666040ff737181662824ea33cd019890181f9.tar.gz
Python 3: dict.items() doesn't return a list anymore
Use sorted() instead, which works on lists as well as dict_items objects.
Diffstat (limited to 'paste/exceptions')
-rw-r--r--paste/exceptions/formatter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/exceptions/formatter.py b/paste/exceptions/formatter.py
index c83ab50..09309de 100644
--- a/paste/exceptions/formatter.py
+++ b/paste/exceptions/formatter.py
@@ -217,7 +217,7 @@ class TextFormatter(AbstractFormatter):
elif isinstance(value, dict):
lines = ['\n', title, '-'*len(title)]
items = value.items()
- items.sort()
+ items = sorted(items)
for n, v in items:
try:
v = repr(v)
@@ -303,7 +303,7 @@ class HTMLFormatter(TextFormatter):
def zebra_table(self, title, rows, table_class="variables"):
if isinstance(rows, dict):
rows = rows.items()
- rows.sort()
+ rows = sorted(rows)
table = ['<table class="%s">' % table_class,
'<tr class="header"><th colspan="2">%s</th></tr>'
% self.quote(title)]