Commit ceb63ce0 authored by agronholm's avatar agronholm

Fixed Python 3 compatibility issue introduced in #435

--HG--
branch : distribute
extra : rebase_source : 6b45a12ed6d990d6a6b2bf25e9bb2bca53fbd5c6
parent c6026b93
......@@ -399,10 +399,13 @@ def extractall(self, path=".", members=None):
self.extract(tarinfo, path)
# Reverse sort directories.
def sorter(dir1, dir2):
return cmp(dir1.name, dir2.name)
directories.sort(sorter)
directories.reverse()
if sys.version_info < (2, 4):
def sorter(dir1, dir2):
return cmp(dir1.name, dir2.name)
directories.sort(sorter)
directories.reverse()
else:
directories.sort(key=operator.attrgetter('name'), reverse=True)
# Set correct owner, mtime and filemode on directories.
for tarinfo in directories:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment