1
0
forked from VimPlug/jedi

Merge pull request #1313 from CXuesong/master

get_module_names should include top-level async functions when all_scopes=False.
This commit is contained in:
Dave Halter
2019-04-13 00:43:58 +02:00
committed by GitHub
2 changed files with 40 additions and 0 deletions
+3
View File
@@ -190,6 +190,9 @@ def get_module_names(module, all_scopes):
# but that would be a big change that could break type inference, whereas for now
# this discrepancy looks like only a problem for "get_module_names".
parent_scope = parent_scope.parent
# async functions have an extra wrapper. Strip it.
if parent_scope and parent_scope.type == 'async_stmt':
parent_scope = parent_scope.parent
return parent_scope in (module, None)
names = [n for n in names if is_module_scope_name(n)]