summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/formats.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py
index c23a37cb2b..1eb7a3d837 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -24,7 +24,9 @@ def iter_format_modules(lang):
format_locations.append(settings.FORMAT_MODULE_PATH + '.%s')
format_locations.reverse()
locale = to_locale(lang)
- locales = set((locale, locale.split('_')[0]))
+ locales = [locale]
+ if '_' in locale:
+ locales.append(locale.split('_')[0])
for location in format_locations:
for loc in locales:
try: