From 98914b8b0ab308c7a91ab859d597b24fdca8cb35 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 24 Apr 2014 23:39:12 +0200 Subject: [PATCH] Fix a traceback when sorting a listwin --- src/windows.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/windows.py b/src/windows.py index 05c073e0..3b45aae1 100644 --- a/src/windows.py +++ b/src/windows.py @@ -2324,9 +2324,10 @@ class ListWin(Win): if not col_name: return elif asc: - self.lines.sort(key=lambda x: x[col_name]) + self.lines.sort(key=lambda x: x[self._columns[col_name]]) else: - self.lines.sort(key=lambda x: x[col_name], reverse=True) + self.lines.sort(key=lambda x: x[self._columns[col_name]], + reverse=True) self.refresh() curses.doupdate()