From f8b0e3636297abcf79910eb43cfb862e37d23511 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 21 Apr 2021 08:58:32 -0500 Subject: [PATCH] spellchecker: fix an error that occurs if there is no dictionary available for the current language --- src/extra/SpellChecker/spellchecker.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/extra/SpellChecker/spellchecker.py b/src/extra/SpellChecker/spellchecker.py index 7a35a22..19882b5 100644 --- a/src/extra/SpellChecker/spellchecker.py +++ b/src/extra/SpellChecker/spellchecker.py @@ -1,8 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals -from builtins import next -from builtins import object import os import logging from . import wx_ui @@ -30,7 +26,7 @@ class spellChecker(object): log.debug("Using language: %s" % (languageHandler.getLanguage(),)) self.dict = enchant.DictWithPWL(languageHandler.getLanguage()[:2], os.path.join(paths.config_path(), "wordlist.dict")) except DictNotFoundError: - log.exception("Dictionary for language %s not found." % (dictionary,)) + log.exception("Dictionary for language %s not found." % (languageHandler.getLanguage(),)) wx_ui.dict_not_found_error() self.active = False self.checker = SpellChecker(self.dict, filters=[twitterFilter.TwitterFilter, tokenize.EmailFilter, tokenize.URLFilter])