forked from VimPlug/jedi
Merge branch 'master' into typeshed
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user