From 96adef7c60b29d912f5e04b49fd588c26fe09b9c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 17 May 2017 17:46:33 -0700 Subject: [PATCH] Fix some Py3 compatibility issues --- wx/py/shell.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wx/py/shell.py b/wx/py/shell.py index b8eed3a8..a5fa6a71 100644 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -750,10 +750,12 @@ class Shell(editwindow.EditWindow): #unique (no duplicate words #oneliner from german python forum => unique list - unlist = [thlist[i] for i in xrange(len(thlist)) if thlist[i] not in thlist[:i]] + unlist = [thlist[i] for i in range(len(thlist)) if thlist[i] not in thlist[:i]] #sort lowercase - unlist.sort(lambda a, b: cmp(a.lower(), b.lower())) + def _cmp(a,b): + return ((a > b) - (a < b)) + unlist.sort(lambda a, b: _cmp(a.lower(), b.lower())) #this is more convenient, isn't it? self.AutoCompSetIgnoreCase(True)