mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -2016,7 +2016,7 @@ class TarFile(object):
|
|||
self.extract(tarinfo, path)
|
||||
|
||||
# Reverse sort directories.
|
||||
directories.sort(lambda a, b: cmp(a.name, b.name))
|
||||
directories.sort(key=lambda a: a.name)
|
||||
directories.reverse()
|
||||
|
||||
# Set correct owner, mtime and filemode on directories.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue