QScintilla/SpellChecker.py

changeset 2210
e02bb8cbf145
parent 2208
c63e2ab86189
child 2280
8e85ca3fabe7
--- a/QScintilla/SpellChecker.py	Fri Nov 09 16:37:21 2012 +0100
+++ b/QScintilla/SpellChecker.py	Fri Nov 09 17:57:48 2012 +0100
@@ -99,7 +99,7 @@
             return os.path.join(Utilities.getConfigDir(), "spelling", "pwl.dic")
     
     @classmethod
-    def getUserDictionaryPath(cls, isException):
+    def getUserDictionaryPath(cls, isException=False):
         """
         Class method to get the path name of a user dictionary file.
         
@@ -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