]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
remove sorted and don't assume dict ordering (Python 2.3 & Jython compat)
authorPhilip Jenvey <pjenvey@underboss.org>
Fri, 25 Sep 2009 20:29:11 +0000 (20:29 +0000)
committerPhilip Jenvey <pjenvey@underboss.org>
Fri, 25 Sep 2009 20:29:11 +0000 (20:29 +0000)
babel/localedata.py
babel/messages/frontend.py

index 203bec80079efcc9676a23e1a1531ffa76ce910a..9308b5ecf6eccc2506d41696992223e86adb5265 100644 (file)
@@ -120,8 +120,8 @@ def merge(dict1, dict2):
     
     >>> 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
index 501e68b93f4f43ff0f817220c5421741231dc4ae..b1ebfb4a7c6202609af6369a53452cf9d227abeb 100755 (executable)
@@ -638,8 +638,9 @@ class CommandLineInterface(object):
         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