From 14fa4e59726f7be0fc009c360cc1df50be7fd746 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 17 Apr 2014 21:03:23 +0530 Subject: [PATCH] Do not fail on system where get_system_locale() is None (OS X) --- src/calibre/spell/dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/spell/dictionary.py b/src/calibre/spell/dictionary.py index 0bc8220e1d..82dfe03393 100644 --- a/src/calibre/spell/dictionary.py +++ b/src/calibre/spell/dictionary.py @@ -98,7 +98,7 @@ def custom_dictionaries(reread=False): return _custom default_en_locale = 'en-US' -ul = parse_lang_code(get_system_locale()) +ul = parse_lang_code(get_system_locale() or 'en-US') if ul is not None and ul.langcode == 'eng' and ul.countrycode in 'GB BS BZ GH IE IN JM NZ TT'.split(): default_en_locale = 'en-' + ul.countrycode default_preferred_locales = {'eng':default_en_locale, 'deu':'de-DE', 'spa':'es-ES', 'fra':'fr-FR'}