mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-11 23:44:33 +12:00
Hotfix of unhandled exception by language_tool_python (#870)
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
9bdd80f244
commit
7e05b72d83
|
@ -552,7 +552,10 @@ class LanguageToolDictionary(BasicDictionary):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getTool():
|
def getTool():
|
||||||
if LanguageToolDictionary._tool == None:
|
if LanguageToolDictionary._tool == None:
|
||||||
LanguageToolDictionary._tool = languagetool.LanguageTool()
|
try:
|
||||||
|
LanguageToolDictionary._tool = languagetool.LanguageTool()
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
return LanguageToolDictionary._tool
|
return LanguageToolDictionary._tool
|
||||||
|
|
||||||
|
@ -569,7 +572,7 @@ class LanguageToolDictionary(BasicDictionary):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def isInstalled():
|
def isInstalled():
|
||||||
if languagetool != None:
|
if (languagetool != None) and (LanguageToolDictionary.getTool() != None):
|
||||||
|
|
||||||
# This check, if Java is installed, is necessary to
|
# This check, if Java is installed, is necessary to
|
||||||
# make sure LanguageTool can be run without problems.
|
# make sure LanguageTool can be run without problems.
|
||||||
|
|
Loading…
Reference in a new issue