mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
Convert cmp= to key= in sort method call for Python3 compatibility
This commit is contained in:
parent
67c2c115c0
commit
3f48f2863c
1 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@ import six
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import zipfile
|
import zipfile
|
||||||
|
import functools
|
||||||
from xml.etree.ElementTree import XML
|
from xml.etree.ElementTree import XML
|
||||||
from servo.util import download_file
|
from servo.util import download_file
|
||||||
import six.moves.urllib as urllib
|
import six.moves.urllib as urllib
|
||||||
|
@ -103,7 +104,7 @@ def archive_deterministically(dir_to_archive, dest_archive, prepend_path=None):
|
||||||
|
|
||||||
# Sort file entries with the fixed locale
|
# Sort file entries with the fixed locale
|
||||||
with setlocale('C'):
|
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
|
# Use a temporary file and atomic rename to avoid partially-formed
|
||||||
# packaging (in case of exceptional situations like running out of disk space).
|
# packaging (in case of exceptional situations like running out of disk space).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue