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