Skip to content

Commit

Permalink
Fix thirdparty to work with newer astroid
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Feb 5, 2024
1 parent 3a73b96 commit 3d05abb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions saltpylint/thirdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class ThirdPartyImportsChecker(BaseChecker):
),
)

known_py2_modules: ClassVar = ["__builtin__", "exceptions"]
known_py3_modules: ClassVar = ["builtins"]

unix_modules = (
Expand Down Expand Up @@ -87,7 +86,7 @@ class ThirdPartyImportsChecker(BaseChecker):
if path == std_modules_path and mod not in unix_modules + win_modules:
std_modules.append(mod)

known_std_modules = known_py2_modules + known_py3_modules + std_modules
known_std_modules = known_py3_modules + std_modules

def __init__(self, linter=None) -> None:
BaseChecker.__init__(self, linter)
Expand All @@ -111,10 +110,10 @@ def visit_if(self, node):
def leave_if(self, node):
self._inside_if = True

def visit_tryexcept(self, node):
def visit_try(self, node):
self._inside_try_except = True

def leave_tryexcept(self, node):
def leave_try(self, node):
self._inside_try_except = False

def visit_functiondef(self, node):
Expand Down

0 comments on commit 3d05abb

Please sign in to comment.