Merge remote-tracking branch 'origin/master' into typeshed

This commit is contained in:
Dave Halter
2019-04-13 01:52:15 +02:00
5 changed files with 56 additions and 2 deletions
+1 -1
View File
@@ -397,7 +397,7 @@ class Completion(BaseDefinition):
def _complete(self, like_name):
append = ''
if settings.add_bracket_after_function \
and self.type == 'Function':
and self.type == 'function':
append = '('
if self._name.api_type == 'param' and self._stack is not None:
+4 -1
View File
@@ -334,7 +334,10 @@ def get_system_environment(version):
if os.name == 'nt':
for exe in _get_executables_from_windows_registry(version):
return Environment(exe)
try:
return Environment(exe)
except InvalidPythonEnvironment:
pass
raise InvalidPythonEnvironment("Cannot find executable python%s." % version)
+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)]