Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb719fa

Browse files
committed
Make sort-test.py Python 3 compatible
Python 2 is still supported.
1 parent3d59da9 commitcb719fa

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
importsys,string,locale
44
locale.setlocale(locale.LC_ALL,"")
55

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

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp