Skip to content

Commit

Permalink
Convert cmp= to key= in sort method call for Python3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Dec 9, 2019
1 parent 67c2c11 commit 3f48f28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/servo/command_base.py
Expand Up @@ -27,6 +27,7 @@
import sys
import tarfile
import zipfile
import functools
from xml.etree.ElementTree import XML
from servo.util import download_file
import six.moves.urllib as urllib
Expand Down Expand Up @@ -103,7 +104,7 @@ def reset(tarinfo):

# Sort file entries with the fixed locale
with setlocale('C'):
file_list.sort(cmp=locale.strcoll)
file_list.sort(key=functools.cmp_to_key(locale.strcoll))

# Use a temporary file and atomic rename to avoid partially-formed
# packaging (in case of exceptional situations like running out of disk space).
Expand Down

0 comments on commit 3f48f28

Please sign in to comment.