Typing does not need to be installed for Jedi to work, vendored typeshed is enough

This commit is contained in:
Dave Halter
2018-12-16 17:26:56 +01:00
parent af51c9cc33
commit 33b73d7fbc
2 changed files with 21 additions and 8 deletions

View File

@@ -161,7 +161,12 @@ class Evaluator(object):
@evaluator_function_cache()
def typing_module(self):
typing_module, = self.import_module((u'typing',))
return typing_module.stub_context
try:
return typing_module.stub_context
except AttributeError:
# Python 2 and 3.4: In some cases there is no non-stub module,
# because the module was not installed with `pip install typing`.
return typing_module
def reset_recursion_limitations(self):
self.recursion_detector = recursion.RecursionDetector()