diff options
author | Guido van Rossum <guido@python.org> | 2008-01-15 17:41:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-01-15 17:41:38 (GMT) |
commit | f7bd964fb5364e6cf8feac5f088e214b4f4e9478 (patch) | |
tree | 32cd1bfe19bb21746be4eff1a65bced8217bf79a /Tools/i18n | |
parent | 386cd1e3c950b038fefefbf5ad887fd7f3215dc8 (diff) | |
download | cpython-f7bd964fb5364e6cf8feac5f088e214b4f4e9478.zip cpython-f7bd964fb5364e6cf8feac5f088e214b4f4e9478.tar.gz cpython-f7bd964fb5364e6cf8feac5f088e214b4f4e9478.tar.bz2 |
Patch #1830 by Peter Harris, fix some 2.x-isms.
Diffstat (limited to 'Tools/i18n')
-rwxr-xr-x | Tools/i18n/pygettext.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py index 839846e..bdf52e0 100755 --- a/Tools/i18n/pygettext.py +++ b/Tools/i18n/pygettext.py @@ -453,11 +453,9 @@ class TokenEater: # sort all the entries by their first item. reverse = {} for k, v in self.__messages.items(): - keys = v.keys() - keys.sort() + keys = sorted(v.keys()) reverse.setdefault(tuple(keys), []).append((k, v)) - rkeys = reverse.keys() - rkeys.sort() + rkeys = sorted(reverse.keys()) for rkey in rkeys: rentries = reverse[rkey] rentries.sort() @@ -469,8 +467,7 @@ class TokenEater: # k is the message string, v is a dictionary-set of (filename, # lineno) tuples. We want to sort the entries in v first by # file name and then by line number. - v = v.keys() - v.sort() + v = sorted(v.keys()) if not options.writelocations: pass # location comments are different b/w Solaris and GNU: @@ -662,7 +659,6 @@ def main(): if __name__ == '__main__': main() # some more test strings - _(u'a unicode string') # this one creates a warning _('*** Seen unexpected token "%(token)s"') % {'token': 'test'} _('more' 'than' 'one' 'string') |