Skip to content

Commit

Permalink
fix deprecated access to pylint version #23
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed May 25, 2021
1 parent 4f5119f commit e9f5583
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pylint_quotes/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@

import tokenize

from pylint.__pkginfo__ import numversion as pylint_version
from pylint.checkers import BaseTokenChecker
from pylint.interfaces import IAstroidChecker, ITokenChecker

try:
from pylint import version as pv
except ImportError:
# Backwards compatibility (pylint<2.8.0)
from pylint.__pkginfo__ import version as pv

pylint_version = tuple(pv.split("."))

CONFIG_OPTS = ('single', 'double')
SMART_CONFIG_OPTS = tuple('%s-avoid-escape' % c for c in CONFIG_OPTS)

Expand Down Expand Up @@ -357,7 +364,7 @@ def get_offset(col):
Returns:
dict: Keyword arguments to pass to add_message
"""
if ('2', '2', '2') < tuple(map(str, pylint_version)):
if ('2', '2', '2') < pylint_version:
return {'col_offset': col}
return {}

Expand Down

0 comments on commit e9f5583

Please sign in to comment.