mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Make sort-test.py Python 3 compatible
Python 2 is still supported.
This commit is contained in:
parent
3d59da9ccd
commit
cb719fa02d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user