Mercurial > babel > old > babel-test
diff babel/core.py @ 534:e8da49740876
catch exception if environment contains an invalid locale setting (fixes #200)
author | fschwarz |
---|---|
date | Fri, 11 Mar 2011 16:20:57 +0000 |
parents | 85e1beadacb0 |
children | 423bb50cb8af |
line wrap: on
line diff
--- a/babel/core.py +++ b/babel/core.py @@ -659,7 +659,10 @@ locale = 'en_US_POSIX' elif aliases and locale in aliases: locale = aliases[locale] - return '_'.join(filter(None, parse_locale(locale))) + try: + return '_'.join(filter(None, parse_locale(locale))) + except ValueError: + pass def negotiate_locale(preferred, available, sep='_', aliases=LOCALE_ALIASES): """Find the best match between available and requested locale strings.