Skip to content

Commit f7bd964

Browse files
committed
Patch #1830 by Peter Harris, fix some 2.x-isms.
1 parent 386cd1e commit f7bd964

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Tools/i18n/pygettext.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,9 @@ def write(self, fp):
453453
# sort all the entries by their first item.
454454
reverse = {}
455455
for k, v in self.__messages.items():
456-
keys = v.keys()
457-
keys.sort()
456+
keys = sorted(v.keys())
458457
reverse.setdefault(tuple(keys), []).append((k, v))
459-
rkeys = reverse.keys()
460-
rkeys.sort()
458+
rkeys = sorted(reverse.keys())
461459
for rkey in rkeys:
462460
rentries = reverse[rkey]
463461
rentries.sort()
@@ -469,8 +467,7 @@ def write(self, fp):
469467
# k is the message string, v is a dictionary-set of (filename,
470468
# lineno) tuples. We want to sort the entries in v first by
471469
# file name and then by line number.
472-
v = v.keys()
473-
v.sort()
470+
v = sorted(v.keys())
474471
if not options.writelocations:
475472
pass
476473
# location comments are different b/w Solaris and GNU:
@@ -662,7 +659,6 @@ class Options:
662659
if __name__ == '__main__':
663660
main()
664661
# some more test strings
665-
_(u'a unicode string')
666662
# this one creates a warning
667663
_('*** Seen unexpected token "%(token)s"') % {'token': 'test'}
668664
_('more' 'than' 'one' 'string')

0 commit comments

Comments
 (0)