Kaydet (Commit) f7bd964f authored tarafından Guido van Rossum's avatar Guido van Rossum

Patch #1830 by Peter Harris, fix some 2.x-isms.

üst 386cd1e3
...@@ -453,11 +453,9 @@ class TokenEater: ...@@ -453,11 +453,9 @@ class TokenEater:
# sort all the entries by their first item. # sort all the entries by their first item.
reverse = {} reverse = {}
for k, v in self.__messages.items(): for k, v in self.__messages.items():
keys = v.keys() keys = sorted(v.keys())
keys.sort()
reverse.setdefault(tuple(keys), []).append((k, v)) reverse.setdefault(tuple(keys), []).append((k, v))
rkeys = reverse.keys() rkeys = sorted(reverse.keys())
rkeys.sort()
for rkey in rkeys: for rkey in rkeys:
rentries = reverse[rkey] rentries = reverse[rkey]
rentries.sort() rentries.sort()
...@@ -469,8 +467,7 @@ class TokenEater: ...@@ -469,8 +467,7 @@ class TokenEater:
# k is the message string, v is a dictionary-set of (filename, # k is the message string, v is a dictionary-set of (filename,
# lineno) tuples. We want to sort the entries in v first by # lineno) tuples. We want to sort the entries in v first by
# file name and then by line number. # file name and then by line number.
v = v.keys() v = sorted(v.keys())
v.sort()
if not options.writelocations: if not options.writelocations:
pass pass
# location comments are different b/w Solaris and GNU: # location comments are different b/w Solaris and GNU:
...@@ -662,7 +659,6 @@ def main(): ...@@ -662,7 +659,6 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()
# some more test strings # some more test strings
_(u'a unicode string')
# this one creates a warning # this one creates a warning
_('*** Seen unexpected token "%(token)s"') % {'token': 'test'} _('*** Seen unexpected token "%(token)s"') % {'token': 'test'}
_('more' 'than' 'one' 'string') _('more' 'than' 'one' 'string')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment