diff options
Diffstat (limited to 'pylint/checkers/spelling.py')
-rw-r--r-- | pylint/checkers/spelling.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index 725f25a..9495f4d 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -21,21 +21,20 @@ import tokenize import string import re +try: + import enchant +except ImportError: + enchant = None import six -if sys.version_info[0] >= 3: - maketrans = str.maketrans -else: - maketrans = string.maketrans - from pylint.interfaces import ITokenChecker, IAstroidChecker from pylint.checkers import BaseTokenChecker from pylint.checkers.utils import check_messages -try: - import enchant -except ImportError: - enchant = None +if sys.version_info[0] >= 3: + maketrans = str.maketrans +else: + maketrans = string.maketrans if enchant is not None: br = enchant.Broker() @@ -51,6 +50,7 @@ else: table = maketrans("", "") + class SpellingChecker(BaseTokenChecker): """Check spelling in comments and docstrings""" __implements__ = (ITokenChecker, IAstroidChecker) |