From 250ac77f4ac3a858d0c9c8daffbf190e67f1485a Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 24 Aug 2019 01:09:26 +0200 Subject: [PATCH] Remove a check that is not needed --- jedi/inference/base_value.py | 6 ++---- jedi/inference/context.py | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/jedi/inference/base_value.py b/jedi/inference/base_value.py index 0619a7c4..24d42434 100644 --- a/jedi/inference/base_value.py +++ b/jedi/inference/base_value.py @@ -8,7 +8,7 @@ just one. """ from functools import reduce from operator import add -from parso.python.tree import ExprStmt, SyncCompFor, Name, Param +from parso.python.tree import ExprStmt, SyncCompFor, Name from jedi import debug from jedi._compatibility import zip_longest, unicode @@ -82,9 +82,7 @@ class HelperValueMixin(object): n = name_or_str.value if isinstance(name_or_str, Name) else name_or_str values = self.py__getattribute__alternatives(n) - if not names and analysis_errors and not values \ - and not (isinstance(name_or_str, Name) and - isinstance(name_or_str.parent.parent, Param)): + if not names and not values and analysis_errors: if isinstance(name_or_str, Name): from jedi.inference import analysis analysis.add_attribute_error( diff --git a/jedi/inference/context.py b/jedi/inference/context.py index 5c4b097d..9f400eed 100644 --- a/jedi/inference/context.py +++ b/jedi/inference/context.py @@ -1,7 +1,7 @@ from abc import abstractmethod from parso.tree import search_ancestor -from parso.python.tree import Name, Param +from parso.python.tree import Name from jedi.inference.filters import ParserTreeFilter, MergedFilter, \ GlobalNameFilter @@ -39,9 +39,7 @@ class AbstractContext(object): name_context = self names, f = self._goto(name_or_str, position) values = f.find(names, attribute_lookup=False) - if not names and analysis_errors and not values \ - and not (isinstance(name_or_str, Name) and - isinstance(name_or_str.parent.parent, Param)): + if not names and not values and analysis_errors: if isinstance(name_or_str, Name): from jedi.inference import analysis message = ("NameError: name '%s' is not defined."