Fix for list.sort requiring keywords in python3.5

Python3.5 changed the parameters in list.sort to be keyword only
arguments.

This fixes all the instances I could find.
This commit is contained in:
Bob White
2017-09-07 09:35:33 -05:00
parent 03248e0932
commit 251f9d7d5a
5 changed files with 6 additions and 6 deletions

View File

@@ -766,7 +766,7 @@ class RibbonBar(RibbonControl):
# Sneaky obj array trickery to not copy the tab descriptors
sorted_pages.append(info)
sorted_pages.sort(self.OrderPageTabInfoBySmallWidthAsc)
sorted_pages.sort(key=self.OrderPageTabInfoBySmallWidthAsc)
width -= tabsep*(numtabs - 1)
for i, info in enumerate(self._pages):

View File

@@ -10406,7 +10406,7 @@ class UltimateListMainWindow(wx.ScrolledWindow):
else:
self.__func = func
self._lines.sort(self.OnCompareItems)
self._lines.sort(key=self.OnCompareItems)
if self.IsShownOnScreen():
self._dirty = True

View File

@@ -2219,7 +2219,7 @@ class DocManager(wx.EvtHandler):
if sort:
def tempcmp(a, b):
return cmp(a.GetDescription(), b.GetDescription())
templates.sort(tempcmp)
templates.sort(key=tempcmp)
strings = []
for temp in templates:
@@ -2259,7 +2259,7 @@ class DocManager(wx.EvtHandler):
if sort:
def tempcmp(a, b):
return cmp(a.GetViewTypeName(), b.GetViewTypeName())
templates.sort(tempcmp)
templates.sort(key=tempcmp)
res = wx.GetSingleChoiceIndex(_("Select a document view:"),
_("Views"),

View File

@@ -755,7 +755,7 @@ class Shell(editwindow.EditWindow):
#sort lowercase
def _cmp(a,b):
return ((a > b) - (a < b))
unlist.sort(lambda a, b: _cmp(a.lower(), b.lower()))
unlist.sort(key=lambda a, b: _cmp(a.lower(), b.lower()))
#this is more convenient, isn't it?
self.AutoCompSetIgnoreCase(True)

View File

@@ -2140,7 +2140,7 @@ class SlicesShell(editwindow.EditWindow):
unlist = [thlist[i] for i in xrange(len(thlist)) if thlist[i] not in thlist[:i]]
#sort lowercase
unlist.sort(lambda a, b: cmp(a.lower(), b.lower()))
unlist.sort(key=lambda a, b: cmp(a.lower(), b.lower()))
#this is more convenient, isn't it?
self.AutoCompSetIgnoreCase(True)