mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix quite a few more tests. Only about a fifth failing now
This commit is contained in:
@@ -3,6 +3,7 @@ from jedi.inference.value.module import ModuleValue
|
||||
from jedi.inference.filters import ParserTreeFilter, \
|
||||
TreeNameDefinition
|
||||
from jedi.inference.gradual.typing import TypingModuleFilterWrapper
|
||||
from jedi.inference.context import ModuleContext
|
||||
|
||||
|
||||
class StubModuleValue(ModuleValue):
|
||||
@@ -58,6 +59,17 @@ class TypingModuleWrapper(StubModuleValue):
|
||||
for f in filters:
|
||||
yield f
|
||||
|
||||
def as_context(self):
|
||||
return TypingModuleContext(self)
|
||||
|
||||
|
||||
class TypingModuleContext(ModuleContext):
|
||||
def get_filters(self, *args, **kwargs):
|
||||
filters = super(TypingModuleContext, self).get_filters(*args, **kwargs)
|
||||
yield TypingModuleFilterWrapper(next(filters))
|
||||
for f in filters:
|
||||
yield f
|
||||
|
||||
|
||||
# From here on down we make looking up the sys.version_info fast.
|
||||
class _StubName(TreeNameDefinition):
|
||||
|
||||
Reference in New Issue
Block a user