Explicit error type

This commit is contained in:
Tim Bentley 2010-09-20 17:33:38 +01:00
parent 293443ba61
commit fe6a3af42c

View File

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