Commit cb719fa0 authored by Peter Eisentraut's avatar Peter Eisentraut

Make sort-test.py Python 3 compatible

Python 2 is still supported.
parent 3d59da9c
......@@ -3,7 +3,7 @@
import sys, string, locale
locale.setlocale(locale.LC_ALL, "")
if len(sys.argv) <> 2:
if len(sys.argv) != 2:
sys.stderr.write("Usage: sort.py filename\n")
sys.exit(1)
......@@ -14,5 +14,5 @@ infile.close()
for i in range(0, len(list)):
list[i] = list[i][:-1] # chop!
list.sort(locale.strcoll)
print string.join(list, '\n')
list.sort(key=locale.strxfrm)
print('\n'.join(list))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment