mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-07 08:21:52 +08:00
More cleanups in the parser.
This commit is contained in:
@@ -191,7 +191,7 @@ def follow_param(module_context, param):
|
||||
[p for param_str in _search_param_in_docstr(docstring, str(param.name))
|
||||
for p in _evaluate_for_statement_string(module_context, param_str)]
|
||||
)
|
||||
func = param.parent_function
|
||||
func = param.get_parent_function()
|
||||
types = eval_docstring(func.raw_doc)
|
||||
if func.name.value == '__init__':
|
||||
cls = search_ancestor(func, 'classdef')
|
||||
|
||||
@@ -98,7 +98,7 @@ class NameFinder(object):
|
||||
if self._context.predefined_names:
|
||||
# TODO is this ok? node might not always be a tree.Name
|
||||
node = self._name
|
||||
while node is not None and not isinstance(node, tree.IsScope):
|
||||
while node is not None and not node.is_scope():
|
||||
node = node.parent
|
||||
if node.type in ("if_stmt", "for_stmt", "comp_for"):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user