mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Some Bugfixes
This commit is contained in:
@@ -172,7 +172,7 @@ class Evaluator(object):
|
||||
@evaluator_function_cache()
|
||||
def typing_module(self):
|
||||
typing_module, = self.import_module((u'typing',))
|
||||
return typing_module.stub_context or typing_module
|
||||
return typing_module
|
||||
|
||||
def reset_recursion_limitations(self):
|
||||
self.recursion_detector = recursion.RecursionDetector()
|
||||
|
||||
@@ -85,7 +85,10 @@ class CompiledObject(Context):
|
||||
@property
|
||||
def string_names(self):
|
||||
# For modules
|
||||
return tuple(self.py__name__().split('.'))
|
||||
name = self.py__name__()
|
||||
if name is None:
|
||||
return []
|
||||
return tuple(name.split('.'))
|
||||
|
||||
def get_qualified_names(self):
|
||||
return self.string_names
|
||||
|
||||
@@ -348,7 +348,7 @@ class FunctionExecutionContext(TreeContext):
|
||||
generics = (yield_contexts.py__class__(), NO_CONTEXTS)
|
||||
return ContextSet(
|
||||
# In Python 3.6 AsyncGenerator is still a class.
|
||||
AnnotatedSubClass(c.stub_context or c, generics)
|
||||
AnnotatedSubClass(c, generics)
|
||||
for c in async_generator_classes
|
||||
).execute_annotation()
|
||||
else:
|
||||
@@ -359,10 +359,7 @@ class FunctionExecutionContext(TreeContext):
|
||||
# Only the first generic is relevant.
|
||||
generics = (return_contexts.py__class__(), NO_CONTEXTS, NO_CONTEXTS)
|
||||
return ContextSet(
|
||||
AnnotatedSubClass(
|
||||
c if c.stub_context is None else c.stub_context,
|
||||
generics
|
||||
) for c in async_classes
|
||||
AnnotatedSubClass(c, generics) for c in async_classes
|
||||
).execute_annotation()
|
||||
else:
|
||||
if is_generator:
|
||||
|
||||
@@ -513,8 +513,8 @@ class AbstractAnnotatedClass(ClassMixin, ContextWrapper):
|
||||
filter_ = super(AbstractAnnotatedClass, self)._create_class_filter(
|
||||
cls, origin_scope, is_instance
|
||||
)
|
||||
if cls.stub_context is None:
|
||||
return filter_
|
||||
return filter_
|
||||
# XXX
|
||||
return cls.stub_context.get_stub_only_filter(
|
||||
# Take the first filter, which is here to filter module contents
|
||||
# and wrap it.
|
||||
|
||||
Reference in New Issue
Block a user