forked from openlp/openlp
Explicit error type
This commit is contained in:
parent
293443ba61
commit
fe6a3af42c
@ -28,6 +28,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
import enchant
|
import enchant
|
||||||
|
from enchant import DictNotFoundError
|
||||||
enchant_available = True
|
enchant_available = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
enchant_available = False
|
enchant_available = False
|
||||||
@ -47,7 +48,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
self.dict = enchant.Dict()
|
self.dict = enchant.Dict()
|
||||||
self.highlighter = Highlighter(self.document())
|
self.highlighter = Highlighter(self.document())
|
||||||
self.highlighter.setDict(self.dict)
|
self.highlighter.setDict(self.dict)
|
||||||
except:
|
except DictNotFoundError:
|
||||||
enchant_available = False
|
enchant_available = False
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
|
Loading…
Reference in New Issue
Block a user