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