1
0
forked from VimPlug/jedi

Merge branch 'master' into typeshed

This commit is contained in:
Dave Halter
2018-10-02 19:07:59 +02:00
13 changed files with 78 additions and 16 deletions
+6
View File
@@ -118,6 +118,9 @@ class Evaluator(object):
self.is_analysis = False
self.project = project
self.access_cache = {}
# This setting is only temporary to limit the work we have to do with
# tensorflow and others.
self.infer_enabled = True
self.reset_recursion_limitations()
self.allow_different_encoding = True
@@ -170,6 +173,9 @@ class Evaluator(object):
return self.project._get_sys_path(self, environment=self.environment)
def eval_element(self, context, element):
if not self.infer_enabled:
return NO_CONTEXTS
if isinstance(context, CompForContext):
return eval_node(context, element)
+6 -2
View File
@@ -54,8 +54,12 @@ def get_string_context_set(evaluator):
return execute_evaluated(builtin_from_name(evaluator, u'str'))
def load_module(evaluator, **kwargs):
access_path = evaluator.compiled_subprocess.load_module(**kwargs)
def load_module(evaluator, dotted_name, **kwargs):
# Temporary, some tensorflow builtins cannot be loaded, so it's tried again
# and again and it's really slow.
if dotted_name.startswith('tensorflow.'):
return None
access_path = evaluator.compiled_subprocess.load_module(dotted_name=dotted_name, **kwargs)
if access_path is None:
return None
return create_from_access_path(evaluator, access_path)
+1 -1
View File
@@ -276,7 +276,7 @@ class Importer(object):
return sys_path_mod
def follow(self):
if not self.import_path:
if not self.import_path or not self._evaluator.infer_enabled:
return NO_CONTEXTS
import_names = tuple(