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

Lines changed: 3 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy