fix call signatures

This commit is contained in:
Dave Halter
2014-01-12 02:42:00 +01:00
parent 7a0dc41b62
commit bd239446f5
2 changed files with 5 additions and 4 deletions

View File

@@ -518,7 +518,8 @@ class Script(object):
debug.speed('func_call followed')
return [classes.CallDef(o, index, call) for o in origins
if o.isinstance(er.Function, er.Instance, er.Class)]
if o.isinstance(er.Function, er.Instance, er.Class)
or isinstance(o, compiled.PyObject) and o.type() != 'module']
def _func_call_and_param_index(self):
debug.speed('func_call start')

View File

@@ -15,7 +15,7 @@ class TestCallSignatures(TestCase):
assert signatures[0].call_name == expected_name
assert signatures[0].index == expected_index
def test_call_signatures(self):
def test_simple(self):
def run(source, name, index=0, column=None, line=1):
self._run(source, name, index, line, column)
@@ -72,7 +72,7 @@ class TestCallSignatures(TestCase):
"func(alpha='101',"
run(s, 'func', 0, column=13, line=2)
def test_function_definition_complex(self):
def test_complex(self):
s = """
def abc(a,b):
pass
@@ -106,7 +106,7 @@ class TestCallSignatures(TestCase):
# just don't throw an exception (if numpy doesn't exist, just ignore it)
assert Script(s).call_signatures() == []
def test_function_definition_empty_paren_pre_space(self):
def test_call_signatures_empty_parentheses_pre_space(self):
s = textwrap.dedent("""\
def f(a, b):
pass