forked from VimPlug/jedi
Fix issue with descriptors.
This commit is contained in:
@@ -119,7 +119,7 @@ class NameFinder(object):
|
|||||||
if check is flow_analysis.REACHABLE:
|
if check is flow_analysis.REACHABLE:
|
||||||
break
|
break
|
||||||
|
|
||||||
if names and self._is_name_break_scope(name, stmt):
|
if names and self._is_name_break_scope(stmt):
|
||||||
if self._does_scope_break_immediately(scope, name_list_scope):
|
if self._does_scope_break_immediately(scope, name_list_scope):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@@ -167,12 +167,12 @@ class NameFinder(object):
|
|||||||
result = inst.execute_subscope_by_name('__getattribute__', [name])
|
result = inst.execute_subscope_by_name('__getattribute__', [name])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _is_name_break_scope(self, name, stmt):
|
def _is_name_break_scope(self, stmt):
|
||||||
"""
|
"""
|
||||||
Returns True except for nested imports and instance variables.
|
Returns True except for nested imports and instance variables.
|
||||||
"""
|
"""
|
||||||
if stmt.isinstance(pr.ExprStmt):
|
if stmt.isinstance(pr.ExprStmt):
|
||||||
if isinstance(name, er.InstanceElement) and not name.is_class_var:
|
if isinstance(stmt, er.InstanceElement) and not stmt.is_class_var:
|
||||||
return False
|
return False
|
||||||
elif isinstance(stmt, pr.Import) and stmt.is_nested():
|
elif isinstance(stmt, pr.Import) and stmt.is_nested():
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -682,7 +682,12 @@ class Flow(Scope):
|
|||||||
|
|
||||||
def add_name_call(self, name, call):
|
def add_name_call(self, name, call):
|
||||||
"""Add a name to the names_dict."""
|
"""Add a name to the names_dict."""
|
||||||
self.parent.add_name_call(name, call)
|
parent = self.parent
|
||||||
|
if isinstance(parent, Module):
|
||||||
|
# TODO this also looks like code smell. Look for opportunities to
|
||||||
|
# remove.
|
||||||
|
parent = self._sub_module
|
||||||
|
parent.add_name_call(name, call)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parent(self):
|
def parent(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user