mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-25 10:57:13 +08:00
Jedi raised an error when defined_names was called on empty functions, fixes #697.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user