From 4b99cad20da2149b4f5c3a966645ea38bccb8bcd Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 22 Apr 2020 10:15:58 +0200 Subject: [PATCH 1/2] Fixed bug in loading of dictionary without enchant installed --- nw/tools/spellenchant.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nw/tools/spellenchant.py b/nw/tools/spellenchant.py index a2e056e4..87615bab 100644 --- a/nw/tools/spellenchant.py +++ b/nw/tools/spellenchant.py @@ -26,13 +26,19 @@ """ import logging -import enchant import nw +try: + import enchant +except: + # No need to do anything + # setLanguage will fall back to dummy dictionary + pass from nw.tools.spellcheck import NWSpellCheck logger = logging.getLogger(__name__) + class NWSpellEnchant(NWSpellCheck): def __init__(self): From a03350269e010010a17b6c4c59b77adf7c2a790d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 22 Apr 2020 10:18:07 +0200 Subject: [PATCH 2/2] Removed additional empty line --- nw/tools/spellenchant.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nw/tools/spellenchant.py b/nw/tools/spellenchant.py index 87615bab..18a22e47 100644 --- a/nw/tools/spellenchant.py +++ b/nw/tools/spellenchant.py @@ -38,7 +38,6 @@ from nw.tools.spellcheck import NWSpellCheck logger = logging.getLogger(__name__) - class NWSpellEnchant(NWSpellCheck): def __init__(self):