[Python-3000-checkins] r59979 - python/branches/py3k/Tools/i18n/pygettext.py
guido.van.rossum
python-3000-checkins at python.org
Tue Jan 15 18:41:39 CET 2008
Author: guido.van.rossum
Date: Tue Jan 15 18:41:38 2008
New Revision: 59979
Modified:
python/branches/py3k/Tools/i18n/pygettext.py
Log:
Patch #1830 by Peter Harris, fix some 2.x-isms.
Modified: python/branches/py3k/Tools/i18n/pygettext.py
==============================================================================
--- python/branches/py3k/Tools/i18n/pygettext.py (original)
+++ python/branches/py3k/Tools/i18n/pygettext.py Tue Jan 15 18:41:38 2008
@@ -453,11 +453,9 @@
# 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 @@
# 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 @@
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')
More information about the Python-3000-checkins
mailing list