Fri, 09 Nov 2012 17:53:56 +0100
Fixed an issue in the spell checker causing a traceback (exception from enchant).
QScintilla/SpellChecker.py | file | annotate | diff | comparison | revisions |
--- a/QScintilla/SpellChecker.py Fri Nov 09 17:47:22 2012 +0100 +++ b/QScintilla/SpellChecker.py Fri Nov 09 17:53:56 2012 +0100 @@ -412,12 +412,15 @@ @param word word to get suggestions for (string) @return list of suggestions (list of strings) """ + suggestions = [] spell = self._spelling_dict if spell and len(word) >= self.minimumWordSize: - suggestions = spell.suggest(word) - return suggestions - - return [] + try: + suggestions = spell.suggest(word) + except enchant.errors.Error: + # ignore these + pass + return suggestions def add(self, word=None): """