# HG changeset patch # User jruigrok # Date 1270976462 0 # Node ID d725fd333f613fc44bce43b72c90af5cd2422d51 # Parent 5db33ef166d36519e1057f36e4c9da5c4d9b2bd7 Merged revisions 482 via svnmerge from http://svn.edgewall.org/repos/babel/trunk ........ r482 | pjenvey | 2009-09-25 22:29:11 +0200 (vr, 25 sep 2009) | 2 lines remove sorted and don't assume dict ordering (Python 2.3 & Jython compat) ........ diff --git a/0.9.x/ChangeLog b/0.9.x/ChangeLog --- a/0.9.x/ChangeLog +++ b/0.9.x/ChangeLog @@ -16,6 +16,8 @@ * Fixed negative offset handling of Catalog._set_mime_headers (ticket #165). * Add --project and --version options for commandline (ticket #173). * Add a __ne__() method to the Local class. + * Explicitly sort instead of using sorted() and don't assume ordering + (Python 2.3 and Jython compatibility). Version 0.9.5 diff --git a/0.9.x/babel/localedata.py b/0.9.x/babel/localedata.py --- a/0.9.x/babel/localedata.py +++ b/0.9.x/babel/localedata.py @@ -120,8 +120,8 @@ >>> d = {1: 'foo', 3: 'baz'} >>> merge(d, {1: 'Foo', 2: 'Bar'}) - >>> d - {1: 'Foo', 2: 'Bar', 3: 'baz'} + >>> items = d.items(); items.sort(); items + [(1, 'Foo'), (2, 'Bar'), (3, 'baz')] :param dict1: the dictionary to merge into :param dict2: the dictionary containing the data that should be merged diff --git a/0.9.x/babel/messages/frontend.py b/0.9.x/babel/messages/frontend.py --- a/0.9.x/babel/messages/frontend.py +++ b/0.9.x/babel/messages/frontend.py @@ -638,8 +638,9 @@ if options.list_locales: identifiers = localedata.list() longest = max([len(identifier) for identifier in identifiers]) + identifiers.sort() format = u'%%-%ds %%s' % (longest + 1) - for identifier in sorted(localedata.list()): + for identifier in identifiers: locale = Locale.parse(identifier) output = format % (identifier, locale.english_name) print output.encode(sys.stdout.encoding or