Jedi raised an error when defined_names was called on empty functions, fixes #697.

This commit is contained in:
Dave Halter
2016-07-10 18:15:06 +02:00
parent 1c0aa06c7d
commit 3ad67a4ec7
2 changed files with 21 additions and 8 deletions

View File

@@ -58,6 +58,9 @@ def filter_definition_names(names, origin, position=None):
Filter names that are actual definitions in a scope. Names that are just
used will be ignored.
"""
if not names:
return []
# Just calculate the scope from the first
stmt = names[0].get_definition()
scope = stmt.get_parent_scope()