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.

This commit is contained in:
Raoul Snyman 2011-06-23 07:26:20 +02:00
parent cb60e6e9ef
commit 114412e169
1 changed files with 2 additions and 1 deletions

View File

@ -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')