1
0
forked from VimPlug/jedi

fix a problem found by sith with dynamic params (includes tests)

This commit is contained in:
David Halter
2013-08-12 02:23:44 +04:30
parent 27854a3948
commit faf7e0c422
2 changed files with 11 additions and 5 deletions

View File

@@ -194,7 +194,6 @@ def search_params(param):
first, last = call_path[:i], call_path[i+1:]
if not last and not call_path.index(func_name) != i:
continue
#print first, second, func
scopes = [scope]
if first:
scopes = evaluate.follow_call_path(iter(first), scope, pos)
@@ -203,10 +202,12 @@ def search_params(param):
s = evaluate.find_name(scope, func_name, position=pos,
search_global=not first,
resolve_decorator=False)
#print s, pos, compare, func.parent
comparisons = [getattr(escope, 'base_func', None) or escope.base
for escope in s]
if compare in comparisons:
c = [getattr(escope, 'base_func', None) or escope.base
for escope in s
if escope.isinstance(er.Function, er.Class)
]
if compare in c:
# only if we have the correct function we execute
# it, otherwise just ignore it.
evaluate.follow_paths(iter(last), s, scope)

View File

@@ -63,6 +63,11 @@ def func(c=1):
func(1.0)
# Needs to be here, because in this case func is an import -> shouldn't lead to
# exceptions.
import sys as func
func.sys
# -----------------
# classes
# -----------------