Skip to content

Commit

Permalink
[FIX] ImportError on pylint 2.7.3
Browse files Browse the repository at this point in the history
_basename_in_blacklist_re was renamed to _basename_in_ignore_list_re

See pylint-dev/pylint@d19c773#diff-bd9f73b03b1ce4dab59dfcb60f9ad312e2e61eb85cf50372a300a57c93217177
  • Loading branch information
yajo committed Apr 22, 2021
1 parent cdfebe0 commit 8a69151
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pylint_odoo/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
from pylint.checkers import BaseChecker, BaseTokenChecker
from pylint.interfaces import UNDEFINED
from pylint.interfaces import IAstroidChecker, ITokenChecker
from pylint.utils import _basename_in_blacklist_re
from restructuredtext_lint import lint_file as rst_lint
from six import string_types

from . import settings

try:
from pylint.utils import _basename_in_ignore_list_re
except ImportError:
# Compatibility with pylint < 2.7.3
from pylint.utils import _basename_in_blacklist_re as _basename_in_ignore_list_re

try:
from shutil import which # python3.x
except ImportError:
Expand Down Expand Up @@ -155,8 +160,9 @@ def set_ext_files(self):
fext = os.path.splitext(filename)[1].lower()
fname = os.path.join(root, filename)
# If the file is within black_list_re is ignored
if _basename_in_blacklist_re(fname,
self.linter.config.black_list_re):
if _basename_in_ignore_list_re(
fname, self.linter.config.black_list_re
):
continue
# If the file is within ignores is ignored
find = False
Expand Down

0 comments on commit 8a69151

Please sign in to comment.