From 114412e16922175837221edbb0a9f1587fb127a1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Thu, 23 Jun 2011 07:26:20 +0200 Subject: [PATCH] Fix bug #801000 where Enchant falls over in one or two situations where there is no locale set or it encounters some other problem and generates a generic Error. --- openlp/core/lib/spelltextedit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/spelltextedit.py b/openlp/core/lib/spelltextedit.py index 3e58738ce..57a176a69 100644 --- a/openlp/core/lib/spelltextedit.py +++ b/openlp/core/lib/spelltextedit.py @@ -29,6 +29,7 @@ import re try: import enchant from enchant import DictNotFoundError + from enchant.errors import Error ENCHANT_AVAILABLE = True except ImportError: ENCHANT_AVAILABLE = False @@ -56,7 +57,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit): self.dictionary = enchant.Dict() self.highlighter = Highlighter(self.document()) self.highlighter.spellingDictionary = self.dictionary - except DictNotFoundError: + except Error, DictNotFoundError: ENCHANT_AVAILABLE = False log.debug(u'Could not load default dictionary')