Fixed an issue in the spell checker causing a traceback (exception from enchant). 5_2_x

Fri, 09 Nov 2012 17:53:56 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 09 Nov 2012 17:53:56 +0100
branch
5_2_x
changeset 2205
2df710446e51
parent 2204
71aa8b87104f
child 2220
54a7159146d0

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):
         """

eric ide

mercurial