Content-Length: 271162 | pFad | http://github.com/postgrespro/postgres_cluster/commit/cb719fa02d828a4a5d1746f4282fdecec51b5656

50 Make sort-test.py Python 3 compatible · postgrespro/postgres_cluster@cb719fa · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/cb719fa02d828a4a5d1746f4282fdecec51b5656

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy