Commits

Jun Omae  committed 7c12376

1.0.2dev: follow-up to r11691, `get_known_locales()` works with Babel 1.0dev

`babel.localedata.list` has been renamed to `locale_identifiers` in [babel:r599/trunk].

  • Participants
  • Parent commits b638a95
  • Branches 1.0-stable

Comments (0)

Files changed (1)

File trac/util/datefmt.py

 
 try:
     import babel
+except ImportError:
+    babel = None
+    def get_known_locales():
+        return []
+else:
     from babel import Locale
     from babel.core import LOCALE_ALIASES
     from babel.dates import (
         get_time_format, get_month_names,
         get_period_names, get_day_names
     )
-    from babel.localedata import list as get_known_locales
-
-except ImportError:
-    babel = None
-    def get_known_locales():
-        return []
+    try:
+        from babel.localedata import list as get_known_locales
+    except ImportError:
+        from babel.localedata import locale_identifiers as get_known_locales
 
 from trac.core import TracError
 from trac.util.text import to_unicode, getpreferredencoding