Browse files

Catch OSError if locale/ directory doesn't exist

  • Loading branch information...
1 parent 197eafc commit df245cd05ff2495d256030f8b76a2b1d820e4f97 @stasm stasm committed Jun 3, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 settings.py
View
10 settings.py
@@ -59,9 +59,13 @@
# the `locale` directory. A localizer can add their locale in the l10n
# repository (copy of which is checked out into `locale`) in order to start
# testing the localization on the dev server.
-DEV_LANGUAGES = [loc.replace('_', '-') for loc in os.listdir(path('locale'))
- if os.path.isdir(path('locale', loc)) and
- loc != 'templates']
+try:
+ DEV_LANGUAGES = [
+ loc.replace('_', '-') for loc in os.listdir(path('locale'))
+ if os.path.isdir(path('locale', loc)) and loc != 'templates'
+ ]
+except OSError:
+ DEV_LANGUAGES = ('en-US',)
# On stage/prod, the list of accepted locales is manually maintained. Only
# locales whose localizers have signed off on their work should be listed here.

0 comments on commit df245cd

Please sign in to comment.