Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cb719fa

Browse files
committed
Make sort-test.py Python 3 compatible
Python 2 is still supported.
1 parent 3d59da9 commit cb719fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/locale/sort-test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys, string, locale
44
locale.setlocale(locale.LC_ALL, "")
55

6-
if len(sys.argv) <> 2:
6+
if len(sys.argv) != 2:
77
sys.stderr.write("Usage: sort.py filename\n")
88
sys.exit(1)
99

@@ -14,5 +14,5 @@
1414
for i in range(0, len(list)):
1515
list[i] = list[i][:-1] # chop!
1616

17-
list.sort(locale.strcoll)
18-
print string.join(list, '\n')
17+
list.sort(key=locale.strxfrm)
18+
print('\n'.join(list))

0 commit comments

Comments
 (0)