Added code to ignore an enchant error happening during eric shutdown. eric7

Sat, 10 Dec 2022 11:11:08 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Dec 2022 11:11:08 +0100
branch
eric7
changeset 9600
367d1b4fcca8
parent 9599
dc0666634751
child 9601
5be43798a735

Added code to ignore an enchant error happening during eric shutdown.

src/eric7/EricWidgets/EricSpellCheckedTextEdit.py file | annotate | diff | comparison | revisions
--- a/src/eric7/EricWidgets/EricSpellCheckedTextEdit.py	Fri Dec 09 17:07:18 2022 +0100
+++ b/src/eric7/EricWidgets/EricSpellCheckedTextEdit.py	Sat Dec 10 11:11:08 2022 +0100
@@ -546,10 +546,11 @@
 
             # Build a list of all misspelled words and highlight them
             misspellings = []
-            for (word, pos) in self.__tokenizer(text):
-                if not self.__spellDict.check(word):
-                    self.setFormat(pos, len(word), EnchantHighlighter.ErrorFormat)
-                    misspellings.append((pos, pos + len(word)))
+            with contextlib.suppress(enchant.errors.Error):
+                for (word, pos) in self.__tokenizer(text):
+                    if not self.__spellDict.check(word):
+                        self.setFormat(pos, len(word), EnchantHighlighter.ErrorFormat)
+                        misspellings.append((pos, pos + len(word)))
 
             # Store the list so the context menu can reuse this tokenization
             # pass (Block-relative values so editing other blocks won't

eric ide

mercurial