Skip to content

Commit

Permalink
fixup! Fix unhashable-member crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Sep 11, 2022
1 parent 7091f27 commit a2450c6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions pylint/checkers/utils.py
Expand Up @@ -19,7 +19,7 @@

import _string
import astroid.objects
from astroid import TooManyLevelsError, bases, nodes
from astroid import TooManyLevelsError, nodes
from astroid.context import InferenceContext
from astroid.exceptions import AstroidError
from astroid.nodes._base_nodes import ImportNode
Expand All @@ -38,15 +38,6 @@
nodes.DictComp,
nodes.GeneratorExp,
)
WITH_IGETATTR = (
nodes.Module,
nodes.ClassDef,
nodes.FunctionDef,
astroid.objects.Super,
nodes.Slice,
bases.UnboundMethod,
bases.BaseInstance,
)
EXCEPTIONS_MODULE = "builtins"
ABC_MODULES = {"abc", "_py_abc"}
ABC_METHODS = {
Expand Down Expand Up @@ -1959,7 +1950,7 @@ def is_hashable(node: nodes.NodeNG) -> bool:
for inferred in node.infer():
if inferred is astroid.Uninferable:
return True
if not isinstance(inferred, WITH_IGETATTR):
if not hasattr(inferred, "igetattr"):
return True
hash_fn = next(inferred.igetattr("__hash__"))
if hash_fn.parent is inferred:
Expand Down

0 comments on commit a2450c6

Please sign in to comment.