Skip to content
Permalink
Browse files

Convert cmp= to key= in sort method call for Python3 compatibility

  • Loading branch information
marmeladema committed Oct 28, 2019
1 parent 67c2c11 commit 3f48f2863cf21e3584c908d653e15521aae3ed5c
Showing with 2 additions and 1 deletion.
  1. +2 −1 python/servo/command_base.py
@@ -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
@@ -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).

0 comments on commit 3f48f28

Please sign in to comment.
You can’t perform that action at this time.