summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Markel <amitmarkel@users.noreply.github.com>2020-07-14 13:23:13 +0300
committerGitHub <noreply@github.com>2020-07-14 11:23:13 +0100
commita8886fd1cf9755d08ed348cd05560b42c249c9a5 (patch)
tree07e50d7bea9d87b9ab87ce6357dcffd703b300e5
parent7b6cfdfe132a5f5e6631a5fe8d3492538c1d0d78 (diff)
downloadpaste-git-a8886fd1cf9755d08ed348cd05560b42c249c9a5.tar.gz
Py3-compat middleware.py's make_table's item sort (#55)
In py2 an array is created and sorted, and in py3 an array of the items needs to be realized in the same fashion hence the sorted(•) fix. Otherwise the code will fail on Python 3 since dict.items() returns a view on the items which doesn't have a .sort() method.
-rw-r--r--paste/evalexception/middleware.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py
index d086344..bc2883e 100644
--- a/paste/evalexception/middleware.py
+++ b/paste/evalexception/middleware.py
@@ -456,8 +456,7 @@ class EvalHTMLFormatter(formatter.HTMLFormatter):
def make_table(items):
if isinstance(items, dict):
- items = items.items()
- items.sort()
+ items = sorted(items.items())
rows = []
i = 0
for name, value in items: