mirror of
https://github.com/python/cpython.git
synced 2025-10-13 10:23:28 +00:00
Convert some custom sort comparison functions to equivalent key functions.
This commit is contained in:
parent
fd66e51c4c
commit
d4cb56d4e8
12 changed files with 50 additions and 20 deletions
|
@ -398,7 +398,7 @@ class FileTreeItem(TreeItem):
|
|||
names = os.listdir(self.path)
|
||||
except os.error:
|
||||
return []
|
||||
names.sort(lambda a, b: cmp(os.path.normcase(a), os.path.normcase(b)))
|
||||
names.sort(key = os.path.normcase)
|
||||
sublist = []
|
||||
for name in names:
|
||||
item = FileTreeItem(os.path.join(self.path, name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue